Can I use Composer on my web hosting?
Composer is available on PlanetNode web hosting. Learn how to install and update PHP packages for your website with Composer via SSH.
By Yvan Watchman Updated
Yes, Composer is available on our web hosting. You use it via SSH: log in to your account and run the composer command in your website's folder. You don't need to install Composer yourself.
What you need
- A web hosting package from PlanetNode
- SSH access to your account. Don't have it yet? Open a ticket at planetno.de/ticket.
- An SSH client, such as the terminal on macOS and Linux or PowerShell on Windows
Using Composer
- Connect to your account via SSH. Use the same credentials as for DirectAdmin, or an SSH key (see How do I add SSH keys to my account?):
ssh gebruikersnaam@jouwdomein.nl
- Check that Composer works:
composer --version
- Go to the folder of your website or project:
cd domains/jouwdomein.nl/public_html
- Install the packages from your
composer.json:
composer install
Want to add a new package? Use composer require, for example:
composer require vendor/package
Good to know
Your account runs in an isolated environment (CageFS). You only see and manage your own files, and Composer works within your own home directory. You don't need root or sudo rights.
Tip
Use composer install --no-dev on your live website. That way only the packages your site needs are installed, without development tools.
Checking
After composer install, there is a vendor folder in your project and a composer.lock has been created or updated. Does your site load the packages via vendor/autoload.php? Open your website and check that everything works.
Common problems
- A package requires a different PHP version. Use
php -vto check which PHP version you're using via SSH and compare it with the package's requirements. composer: command not foundor you can't log in via SSH. SSH is then probably not yet enabled for your account. Open a ticket at planetno.de/ticket.
Additional resources
Did this article help you?
Related articles
My email goes to spam or is rejected: SPF, DKIM and DMARC
Does your email end up in spam or get rejected? Check SPF, DKIM and DMARC for your domain and keep the sending limit of 500 emails per day in mind.
How do I create and manage email accounts?
How to create email accounts, forwarders, autoresponders, and spam filters in DirectAdmin.
How can I create and manage MySQL databases?
How to create MySQL databases, manage users, and use phpMyAdmin in DirectAdmin.
I cannot reach my website, what now?
Read here how to solve problems when your website is no longer accessible.