Can I use Composer on a hosting package?
Yes, you can use Composer on Web Hosting, WordPress Hosting and Reseller Hosting: in the terminal, and on WordPress Hosting also with the PHP Composer tool in Plesk. On WordPress Hosting, Composer is not ready as a command in the terminal; there you use PHP Composer, or you install Composer yourself as described below.
Enter a domain name, such as yourdomain.nl.
This value doesn’t fit here. An example: whs1.
Composer in the terminal
Open the terminal of your control panel or make an SSH connection (see Connecting via SSH) and type composer --version. If the terminal shows a version number, Composer is ready on your server and you simply use composer. If you get command not found, install Composer in your own folder:
Download the installer
Type this command and press Enter:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"Install Composer
Type this command and press Enter. Composer is placed as
composer.pharin your home folder.php composer-setup.php --install-dir="$HOME"Remove the installer
php -r "unlink('composer-setup.php');"Use Composer
Start Composer with
phpin front of it, and give the folder of your project with-d. In DirectAdmin, for example (in Plesk your website is in~/httpdocs):php ~/composer.phar install -d ~/domains/yourdomain.nl/public_html
PHP Composer in Plesk (WordPress Hosting)
Log in to Plesk
Log in at
https://whs1.srvnl.nl:8443. You can find your server name in How can I find the server name of my hosting package?Open PHP Composer
On the Dashboard tab, under Dev Tools, click PHP Composer.
Find your composer.json
Click Scan. Plesk searches all folders of your package for
composer.jsonfiles and imports them; this can take a few minutes.Manage the dependencies
After the import you can edit the file, choose the desired mode, set environment variables, and install and update the package dependencies.
Related articles
Thank you for your feedback.

