Composer in ISPConfig

Install Composer in ISPConfig

Find the user of your domain from the ISPConfig admin panel. It should be web[number], EG. web1.

Login SSH as root. Modify /etc/passwd, search web?,

vi /etc/passwd

Change /bin/false to /bin/bash


Change folder protection. Be Careful

chattr -i /var/www/clients/client1/web1

Change folder ownership

chown -R web1 /var/www/clients/client1/web1

login as web user

su - /var/www/clients/client1/web1
cd web

Download and install composer

php -r "copy('', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Check composer

composer -V

Composer install package test

composer require monolog/monolog
composer update

Restore back the setting.

chown -R root /var/www/clients/client1/web1
chattr +i /var/www/clients/client1/web1
vi /etc/passwd
[change back to bin/false]

All done.