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
We've been trying to upgrade our composer but executing the described documentation doesn't actually upgrade the composer of the Plesk Composer module.
After a lot of research, the following command did the job (change the php version accordingly):
Marc Broers Thank you for the provided information. This detail was added into the article.
Please sign in to leave a comment.