The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

composer using wrong php package

Discussion in 'General Discussion' started by SolsWebdesign, Mar 8, 2017.

Tags:
  1. SolsWebdesign

    SolsWebdesign Registered

    Joined:
    Feb 1, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    cPanel Access Level:
    Reseller Owner
    Hi,

    I'm running cPanel 62.0.16, WHM 62.0 (build 16) and am developing magento 2 stores. Composer is installed in /opt/cpanel/ and when navigating to that directory I see

    .. composer ea-apr15 ea-php54 ea-php55 ea-php56 ea-php70 libmcrypt perl5
    so my php70 package is there.

    In my magento 2 directory my magento 2 store uses the ea-php70 just fine. But when I want to use composer I find that composer seems to use ea-php54 (the cPanel default???) and I cannot tell it to use the ea-php70 that I have installed for my magento 2 store.

    I get errors like allow_url_fopen must be enabled (indeed it is enabled for my ea-php70 package and is not enabled for my ea-php54 package) and allowed memory exceeded (my ea-php54 package only has a memory_limit of 32 but I don't use it anyway)

    How can I tell composer to use the ea-php70 package that I specifically made for my magento 2 stores? And why on earth is it using that php54 package??? I can't even run composer self-update because of the php54...

    I have looked everywhere and WHM is great but somehow Composer in cPanel keeps falling back on a package and PHP version that I do not want it to use.

    Can anybody tell me why and how to change that?

    Thank you very much in advance :)
    regards,
    Isolde
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,167
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you upload a PHPINFO file to the document root you are using Composer in and verify which php.ini file is loaded?

    Thank you.
     
  3. SolsWebdesign

    SolsWebdesign Registered

    Joined:
    Feb 1, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    cPanel Access Level:
    Reseller Owner
    Hi,

    In the document root where I use composer I have uploaded a phpinfo.php and the php.ini path reads:
    /opt/cpanel/ea-php70/root/etc
    also, it says at the top PHP Version 7.0.16 as expected. Also it says:
    memory_limit 768M (local value) 128M (master value)
    which is correct and as expected.
    However, composer gets stuck at 128M (the master value) and uses the master php 5.6.30 (cli) which seems to be used by cPanel
    php -v shows me :
    ea-php-cli Copyright 2016 cPanel, Inc.
    PHP 5.6.30 (cli) (built: Feb 22 2017 20:54:02)
    and php -r "echo ini_get('memory_limit').PHP_EOL;" shows me :
    128M
    Because I'm developing Magento 2 stores I want my composer to use my ea-php70 package that I have made for this. However, no matter what I try (e.g. updating PATH), composer keeps using the wrong ea-php package and I can't seem to change that.
    :-(
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,167
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  5. SolsWebdesign

    SolsWebdesign Registered

    Joined:
    Feb 1, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    cPanel Access Level:
    Reseller Owner
    Hello cPanelMichael,

    In the end I moved my non-php7 projects to an older server and set cPanel to default to ea-php70 package. Setting cPanel to default to ea-php70 package and having my non-php7 projects set to ea-php56 did not work well. It is not my preferred solution but because of project pressure I have no choice. Even though it is now "solved" for me I decided to place a ticket anyway, I would like to see Composer use the right package (the one installed where I use Composer rather then the cPanel default php package) or I would like to learn how I can make Composer use the right package :)
    Thank you for your help. My Support Request ID is: 8317099.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,167
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    It looks like we've sent a reply to the ticket. Feel free to reply back to the ticket with any additional questions, and update this thread with the outcome if you can confirm the issue is addressed.

    Thank you.
     
Loading...

Share This Page