How to Use Composer on Your Hosting Account
Composer is the standard dependency manager for PHP, and it's fully supported on your dotCanada hosting account. You can install it via SSH or the cPanel Terminal and use it to manage packages for any PHP project.
Installing Composer
- Connect to your account via SSH or the cPanel Terminal.
- Navigate to your home directory:
cd ~ - Download the Composer installer:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - Run the installer:
php composer-setup.php - Remove the installer:
php -r "unlink('composer-setup.php');" - Move Composer to a global location:
mv composer.phar ~/bin/composer
Using Composer
Once installed, navigate to your project directory and run:
composer install- Install dependencies fromcomposer.jsoncomposer update- Update all dependencies to their latest allowed versionscomposer require vendor/package- Add a new package to your projectcomposer dump-autoload- Regenerate the autoloader
Tips for Shared Hosting
- Use
php composer.pharifcomposerisn't globally available. - Add
--no-devto skip development-only dependencies in production. - Make sure you're using the correct PHP version by running
php -vfirst.
Composer is used by frameworks like Laravel, Symfony, and many others supported on dotCanada. If you run into any issues, contact our support team for help.
100% Satisfaction Guarantee
We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.
Ready to Get Started?
Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.
Get Started Today
