Cannot get PHP 7.2 in shell
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:
[QUOTE]
xxx@zzz:[crons]$ 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.
xxx@zzz:[crons]$ which php
/usr/local/bin/php
[QUOTE] xxx@zzz:[crons]$ /usr/local/bin/ea-php70 -v PHP 7.0.33 (cli) (built: Feb 10 2019 17:39:23) ( 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.2.4, Copyright (c) 2002-2018, by ionCube Ltd. with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
[QUOTE] xxx@zzz:[crons]$ /usr/local/bin/ea-php71 -v PHP 7.1.26 (cli) (built: Feb 10 2019 17:54:56) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd. with Zend OPcache v7.1.26, Copyright (c) 1999-2018, by Zend Technologies
[QUOTE] xxx@zzz:[crons]$ /usr/local/bin/ea-php72 -v 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.
How do I fix this?
[QUOTE] xxx@zzz:[crons]$ /usr/local/bin/ea-php70 -v PHP 7.0.33 (cli) (built: Feb 10 2019 17:39:23) ( 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.2.4, Copyright (c) 2002-2018, by ionCube Ltd. with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
[QUOTE] xxx@zzz:[crons]$ /usr/local/bin/ea-php71 -v PHP 7.1.26 (cli) (built: Feb 10 2019 17:54:56) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd. with Zend OPcache v7.1.26, Copyright (c) 1999-2018, by Zend Technologies
[QUOTE] xxx@zzz:[crons]$ /usr/local/bin/ea-php72 -v 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.
How do I fix this?
-
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. 0 -
Hi @SoftDux What displays for the PHP version when you look use a phpinfo page? 0 -
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.
as root it gives the correct PHP version: [QUOTE] root@zzz:[~]$ /opt/cpanel/ea-php72/root/usr/bin/php -v PHP 7.2.14 (cli) (built: Feb 10 2019 18:20:08) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24. com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd.
But as the user not: [QUOTE] root@zzz:[~]$ su - xxx Last login: Wed Mar 6 21:37:10 SAST 2019 on pts/0 09:04:21 up 1 day, 12:22, 0 users, load average: 0.68, 1.06, 0.98 xxx@zzz:[~]$ /opt/cpanel/ea-php72/root/usr/bin/php -v 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.0 -
Hi @SoftDux What displays for the PHP version when you look use a phpinfo page?
When I run a PHP script with the following code from a web browser it shows PHP 7.2.14
[QUOTE] pi@grafpi ~ $ lynx --dump | grep 'extension version' php extension version 7.2.14
But the same script, run from the command line shows PHP 7.0.33: [QUOTE] xxx@zzz:[~]$ php -q www/phpinfo.php | grep version timelib version => 2016.02 GMP version => 6.0.0 iconv library version => 2.17 imagick module version => 3.4.3 Imagick compiled with ImageMagick version => ImageMagick 6.9.4-10 Q16 x86_64 2017-05-23 g imagick.skip_version_check => 0 => 0 json version => 1.4.0 libmbfl version => 1.3.2 oniguruma version => 5.9.6 mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1. Multibyte regex (oniguruma) version => 5.9.6 libmemcached version => 1.0.18 Client API library version => 10.2.22 Client API header version => 10.2.19-MariaDB Client API version => 10.2.22 RAR EXT version => 4.0.3 UnRAR version => 4.20 patch1 2012-12-16 UnRAR API version => 5 extension 1 SQLite3 module version => 7.0.33 core library version => xmlrpc-epi v. 0.51 php extension version => 7.0.33 Zip version => 1.13.5 Libzip version => 1.3.2 xxx@zzz:[~]$ php -q www/phpinfo.php | grep 'PHP Version' PHP Version => 7.0.33 PHP Version => 7.0.330 -
What does ls -al /opt/cpanel/ea-php72/root/usr/bin/php /usr/local/bin/ea-php72 show? 0 -
What does ls -al /opt/cpanel/ea-php72/root/usr/bin/php /usr/local/bin/ea-php72 show?
as root: [QUOTE] root@zzz:[~]$ ls -al /opt/cpanel/ea-php72/root/usr/bin/php /usr/local/bin/ea-php72 -rwxr-xr-x 1 root root 4822256 Feb 11 01:23 /opt/cpanel/ea-php72/root/usr/bin/php lrwxrwxrwx 1 root root 37 Feb 19 22:06 /usr/local/bin/ea-php72 -> /opt/cpanel/ea-php72/root/usr/bin/php
as user: [QUOTE] root@zzz:[~]$ su - xxx Last login: Thu Mar 7 09:04:21 SAST 2019 on pts/0 13:42:07 up 2 days, 16:59, 0 users, load average: 0.77, 0.96, 1.00 xxx@zzz:[~]$ xxx@zzz:[~]$ ls -al /opt/cpanel/ea-php72/root/usr/bin/php /usr/local/bin/ea-php72 lrwxrwxrwx 1 root root 27 Mar 8 12:24 /opt/cpanel/ea-php72/root/usr/bin/php -> /etc/cl.selector/ea-php-cli lrwxrwxrwx 1 root root 37 Feb 12 2018 /usr/local/bin/ea-php72 -> /opt/cpanel/ea-php72/root/usr/bin/php0 -
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. 0 -
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? 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: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.0 -
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?
pwd
Hi Michael, I am in the user's home folder, as the user:xxx@zzz:[~]$ pwd /home/xxx xxx@zzz:[~]$ 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.
If it doesn't show /home/$username/public_html, browse to the user's public_html directory and see if the issue persists. EX:
cd /home/$username/public_html php -v
The cron script isn't in the public_html folder, but the PHP version is same:xxx@zzz:[~]$ cd public_html/ xxx@zzz:[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. xxx@zzz:[public_html]$ whoami xxx
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.
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.0
Please sign in to leave a comment.
Comments
10 comments