Using Terminal to Target Modules of Assigned PHP Version for cPanel Account
On our WHM/cPanel server I have:
- Installed PHP 8.4 & accompanying modules.
- Created a new cPanel account 'USER01'
- Used WHM MultiPHP Manager to assign 8.4 version to the 'USER01' account
-
However in the 'USER01' cPanel account Tools > Terminal when running the following command:
php -r "echo phpversion('ctype');"
it returns version number 8.1.32 (Default PHP for WHM.)
- Further executing terminal command:
php -m |egrep -i 'intl'
Server returns NULL. Which is true for PHP 8.1 but module 'inlt' is installed on PHP 8.4 and should return a positive confirmation.
QUESTION: when in the cPanel account 'USER01' and using the terminal how do I get the terminal to process the PHP version & modules for 8.4 and NOT the default WHM PHP of 8.1.32??
-
Hey there! This is expected behavior. It's best to call the full PHP version like this to ensure you're working with the proper version on the command line:
/opt/cpanel/ea-php84/root/usr/bin/php -m | egrep -i 'intl'
0 -
Hi cPRex, thank you. The above provided terminal command executes and returns the expected value.
My confusion arose as I thought being in the actual cPanel account with PHP 8.4, the terminal session would return the PHP particulars for said account.
Guess you learn something new everyday. :)
0 -
You would think! But with multi-PHP and all the interaction from that it's best to be explicit whenever possible.
0
Please sign in to leave a comment.
Comments
3 comments