Applicable to:
- Plesk for Linux
Question
How to upgrade PHP composer on a Plesk server?
Answer
-
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).
-
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).
Comments
2 comments
I place the comand as yoour examples and get "No such file or directory"
Following the Ubuntu instructions works as intended. However after a while Composer is downgraded back to 1.x, probably because of Plesk auto updates.
Please sign in to leave a comment.