Upgrade PHP composer on a Plesk server

Upgrade PHP composer on a Plesk server like an expert, with this handy guide from Bobcares.

At Bobcares, we offer solutions for every query, big and small, as part of our Server Management Service.

Let’s take a look at how our Support Team is ready to help customers with upgrading PHP composer on a Plesk server

How to upgrade PHP composer on a Plesk server

The PHP Composer is a tool we can use for dependency management in PHP. It helps us declare libraries that we require for a project. Moreover, we can install or update libraries as and when we need them for a project.

However, Composer is not a package manager like Yum or Apt. Although it deals with libraries or packages, it manages them on a project basis and installs them in the directory within a project.

In other words, Composer does not install anything globally. But it supports a global project via the global command.

upgrade PHP composer on a Plesk server

If you are looking for a guide to help you upgrade the PHP composer on your Plesk Server, our Support Team has your back.

For CentOS / RHEL / CloudLinux:

  1. First, we will connect to the server through SSH.
  2. Then, we will check which version is currently in use:
    # /opt/plesk/php/X.X/bin/php /usr/lib64/plesk-9.0/composer.phar –version

    Here, we have to replace XX with the current PHP version.

  3. The next step is to upgrade or downgrade the version as seen below:
    # /opt/plesk/php/X.X/bin/php /usr/lib64/plesk-9.0/composer.phar self-update

    Here, we have to replace with the preferred composer version respectively.

    In case this command is not successful, we can give the following command a try:

    # /opt/plesk/php/X.X/bin/php /usr/local/psa/var/modules/composer/composer.phar selfupdate –2

    For instance:

    # /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).

For Debian / Ubuntu:

  1. First, we will connect to the server through SSH.
  2. Then, we have to check the version in use currently:
    # /opt/plesk/php/X.X/bin/php /usr/lib/plesk-9.0/composer.phar –version

    Here, we have to replace XX with the current PHP version.

  3. The next step is to upgrade or downgrade the version as seen below:
    # /opt/plesk/php/X.X/bin/php /usr/lib/plesk-9.0/composer.phar self-update

    Here, we have to replace X with the preferred composer version respectively.

    In case this command is not successful, we can give the following command a try:

    # /opt/plesk/php/X.X/bin/php /usr/local/psa/var/modules/composer/composer.phar selfupdate --2

    For instance:

    # /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).

[Looking for a solution to another query? We are just a click away.]

Conclusion

In brief, our skilled Support Engineers at Bobcares demonstrated how to upgrade PHP composer on a Plesk server.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

Reviews