Question
How to upgrade PHP composer on a Plesk server?
Answer
Instructions for CentOS/RHEL/CloudLinux
-
Connect to the server via SSH
-
Check what version is currently used:
Note: replace
X.X
with the current PHP version and<Version>
with the desired composer version.# /opt/plesk/php/X.X/bin/php /usr/lib64/plesk-9.0/composer.phar --version
-
Update or downgrade to the specified version:
# /opt/plesk/php/X.X/bin/php /usr/lib64/plesk-9.0/composer.phar self-update <Version>
Note: In case the command above does not work, use the below one:
/opt/plesk/php/X.X/bin/php /usr/local/psa/var/modules/composer/composer.phar selfupdate --2
For example:
# /opt/plesk/php/7.3/bin/php /usr/lib64/plesk-9.0/composer.phar self-update 2.0.8
Upgrading to version 2.0.8 (stable channel).
Instructions for Debian/Ubuntu
-
Connect to the server via SSH
-
Check what version is currently used:
Note: replace
X.X
with the current PHP version and<Version>
with the desired composer version.# /opt/plesk/php/X.X/bin/php /usr/lib/plesk-9.0/composer.phar --version
-
Update or downgrade to the specified version:
# /opt/plesk/php/X.X/bin/php /usr/lib/plesk-9.0/composer.phar self-update <Version>
Note: In case the command above does not work, use the below one:
/opt/plesk/php/X.X/bin/php /usr/local/psa/var/modules/composer/composer.phar selfupdate --2
For example:
# /opt/plesk/php/7.3/bin/php /usr/lib/plesk-9.0/composer.phar self-update 2.0.8
Upgrading to version 2.0.8 (stable channel).