Articles in this section

Unable to update PHP dependencies via PHP Composer in Plesk: Support for composer 1 is deprecated

kb: bug Plesk for Windows Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

Unable to update PHP dependencies via PHP Composer in Plesk:

PLESK_ERROR: Support for composer 1 is deprecated

Cause

Currently, Plesk is using Composer 1 by default. This behavior is planned to be changed in future extension updates in scope of EXTPHPCOMP-188.

Resolution

As a workaround, update Composer to version 2:

Click on a section to expand

Plesk on Linux
  1. Log in to Plesk
  2. Go to Extensions > search panel.ini editor > click Get it free
  3. Go to Extensions > My Extensions > Panel.ini editor > Edit and add the following strings to the end of the file:

    CONFIG_TEXT: [ext-composer]
    commandInfoPluginVersion = "~1.1.0"
    ComposerVersion = '2'

  4. Go to Tools & Settings > Scheduled tasks (Cronjobs) and click Add task. Paste the following command and click Run now:

    Ubuntu/Debian:

    CONFIG_TEXT: /opt/plesk/php/7.4/bin/php /opt/psa/var/modules/composer/composer.phar self-update --2

    CentOS/RHEL:

    CONFIG_TEXT: /opt/plesk/php/7.4/bin/php /usr/local/psa/var/modules/composer/composer.phar self-update --2

    Note: Use actual PHP version in the command above to update PHP composer

Plesk on Windows
  1. Log in to Plesk
  2. Install Panel.ini Editor extension
  3. Go to Extensions > My Extensions > Panel.ini editor > Editor and add the following strings to the end of the file to keep version 2:

    CONFIG_TEXT: [ext-composer]
    commandInfoPluginVersion = "~1.1.0"
    ComposerVersion = '2'

  4. Run below command in CMD to perform an update: 

    C:\> "%plesk_dir%Additional\PleskPHP74\php.exe" "%plesk_dir%\var\modules\composer\composer.phar" self-update --2

  5. To verify that version is correct execute the following command:  

    C:\> "%plesk_dir%Additional\PleskPHP74\php.exe" "%plesk_dir%\var\modules\composer\composer.phar" --version

    Note: Use actual PHP version in the command above to update PHP composer

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.