Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cannot get PHP 7.2 in shell

Discussion in 'EasyApache' started by SoftDux, Mar 6, 2019.

  1. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    1,024
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Please help.

    I use WHMCS, which is encypted, and thus most of the 3rd party plugins are encrypted with Ioncube as well. Ioncube is very fussy about which version of PHP is being used and as a result this one script doesn't run at all.


    In WHM > MultiPHP Manager I have PHP 7.2 (ea-php72) as system default. On the same page, I have PHP 7.2 selected for this domain.

    Yet, when I login to console with this user, PHP 7.0.33 is the default:




    How do I fix this?
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,923
    Likes Received:
    177
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    Try

    /opt/cpanel/ea-php72/root/usr/bin/php -v

    although, I suspect that something else is going on, that may need to be addressed some where.
     
  3. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    507
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @SoftDux

    What displays for the PHP version when you look use a phpinfo page?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    1,024
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator

    as root it gives the correct PHP version:


    But as the user not:

     
  5. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    1,024
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    When I run a PHP script with the following code from a web browser it shows PHP 7.2.14
    Code:
    <?PHP
    phpinfo();
    ?>
    

    But the same script, run from the command line shows PHP 7.0.33:

     
  6. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,923
    Likes Received:
    177
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    What does

    ls -al /opt/cpanel/ea-php72/root/usr/bin/php /usr/local/bin/ea-php72

    show?
     
  7. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    1,024
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    as root:
    as user:

     
  8. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,923
    Likes Received:
    177
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    You're mixing and matching EasyApache PHP and CloudLinux PHP.

    The PHP version you are seeing in the user's shell is controlled by CloudLinux's voodoo with their CageFS.
     
    cPanelLauren likes this.
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,555
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @SoftDux,

    The system uses the user's configured PHP path to determine which PHP version it calls. Can you let us know the output from the command below when you run the PHP version check as the user?

    Code:
    pwd
    If it doesn't show /home/$username/public_html, browse to the user's public_html directory and see if the issue persists. EX:

    Code:
    cd /home/$username/public_html
    php -v
    If you're using CloudLinux, can you share more information about how you've defined the default PHP version and the account's PHP version?

    Thank you.
     
  10. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    1,024
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    I am in the user's home folder, as the user:
    Code:
    [email protected]:[~]$ pwd
    /home/xxx
    [email protected]:[~]$ php -v
    ea-php-cli Copyright 2017 cPanel, Inc.
    PHP 7.0.33 (cli) (built: Feb 10 2019 12:54:41) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.2, Copyright (c) 2002-2018, by ionCube Ltd.
        with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
        with SourceGuardian v11.2, Copyright (c) 2000-2018, by SourceGuardian Ltd.
    


    The cron script isn't in the public_html folder, but the PHP version is same:

    Code:
    [email protected]:[~]$ cd public_html/
    [email protected]:[public_html]$ php -v
    ea-php-cli Copyright 2017 cPanel, Inc.
    PHP 7.0.33 (cli) (built: Feb 10 2019 12:54:41) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.2, Copyright (c) 2002-2018, by ionCube Ltd.
        with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
        with SourceGuardian v11.2, Copyright (c) 2000-2018, by SourceGuardian Ltd.
    [email protected]:[public_html]$ whoami
    xxx
    
    
    I am not sure what info you're looking for. CloudLinux is installed but I don't see an option in WHM to give users a different PHP version than what they would select in cPanel.
     

    Attached Files:

  11. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,555
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @SoftDux,

    Can you open a support ticket so we can take a closer look at the affected system? Post the ticket number here and I'll link this thread to it.

    Thank you.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice