How to run Composer with Plesk PHP

Follow

Comments

7 comments

  • Avatar
    Robert Perrett

    Plesk latest ver as of Mar 30th.  Composer will not run under php7.2, but runs fine under 7.1 and 7.0

    -bash-4.2$ /opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar update

    PHP Fatal error:  Uncaught Error: Class 'Phar' not found in /usr/lib64/plesk-9.0/composer.phar:23

    Stack trace:

    #0 {main}

      thrown in /usr/lib64/plesk-9.0/composer.phar on line 23

  • Avatar
    Konstantin Annikov

    @Robert Perrett
    Am I right that you are running Plesk Onyx 17.0/17.5 on CloudLinux environment?
    If so, we have an article regarding that:

    Unable to install PHP dependencies via Composer when PHP by CloudLinux is used: Class 'Phar' not found in /usr/lib64/plesk-9.0/composer.phar

    Where it is mentioned, that such bug is fixed in Plesk Onyx 17.8 release.

  • Avatar
    Robert Perrett

    No, I am running the latest. Plesk Onyx Version 17.8.11 Update #47

  • Avatar
    Konstantin Annikov

    @Robert

    Thank you for the update.
    Can you also send me your OS version? I checked this command on CentOS 7 and all is working fine.

    You can check OS version using "#plesk version" command

  • Avatar
    Robert Perrett

    Product version: Plesk Onyx 17.8.11

         Build date: 2019/03/21 17:00

         OS version: CentOS 7.6.1810

           Revision: c3fb546fb867ac424d65da14d8b023f11ec0d150

       Architecture: 64-bit

    Wrapper version: 1.2

  • Avatar
    Robert Perrett

    I also have litespeed installed which changes the php being used

  • Avatar
    Konstantin Annikov (Edited )

    @Robert Perrett

    I have installed lighspeed and executed this command: 

    # /opt/plesk/php/7.2/bin/php /usr/lib64/plesk-9.0/composer.phar update

    with the following composer.json file: 

    CONFIG_TEXT: {
    "require": {
    "monolog/monolog": "1.0.*"
    }
    }

    And the package has been installed as usual:

    CONFIG_TEXT: Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
    \- Installing monolog/monolog (1.0.2): Downloading (100%)
    Writing lock file
    Generating autoload files

    So, I could not reproduce the issue. That is why I recommend you to contact Plesk technical support. Seems that your environment should be checked.

Please sign in to leave a comment.

Have more questions? Submit a request