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/web??

Change folder ownership

chown -R web?? /var/www/clients/client1/web??

login as web user

su - web??
cd web

Download and install composer (one time only).

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

php composer.phar -V


Composer version 2.5.1 2022-12-22 15:33:54

Composer install package test

php composer.phar require monolog/monolog
php composer.phar update

Restore back the setting.

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

All done.