Update cli php to 8.1
How do we update the cli php to 8.1?
We are trying to install software using composer and it's complaining that our php is at version 8.0 when the software require it to be at 8.1 The domain we are installing it on is already set at 8.1 but we suspected it the cli php that it's detecting at 8.0 and we don't see a way to update the cli or toggle it to use 8.1 at cli level.
-
I'm not entirely sure, but try changing the main version in MultiPHP manager in WHM and see if that does it? Otherwise you have a few options: 1) uninstall the old cli version and reinstall the the php package for the version you want 2) symlink /usr/local/bin/php to the version you want 3) (best option) don't rely on the /usr/[local]/bin version at all, and instead call cli from the correct location, ie: [root@server ~]# /opt/cpanel/ea-php81/root/bin/php -v PHP 8.1.19 (cli) (built: May 17 2023 20:21:55) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.19, Copyright (c) Zend Technologies 0 -
I'm not entirely sure, but try changing the main version in MultiPHP manager in WHM and see if that does it? Otherwise you have a few options: 1) uninstall the old cli version and reinstall the the php package for the version you want 2) symlink /usr/local/bin/php to the version you want 3) (best option) don't rely on the /usr/[local]/bin version at all, and instead call cli from the correct location, ie: [root@server ~]# /opt/cpanel/ea-php81/root/bin/php -v PHP 8.1.19 (cli) (built: May 17 2023 20:21:55) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.19, Copyright (c) Zend Technologies
Our issue is the composer is calling the php using the default php cli and there doesn't seem to be a way to force it to call the /opt/cpanel/ea-php81/root/bin/php # php -v PHP 8.0.28 (cli) (built: Jun 6 2023 17:45:40) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.28, Copyright (c) Zend Technologies with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies We could uninstall 8.0 but it would fall back to 7.4 and we cannot uninstall 7.4 due to one of our application compatibly. What would happen if we uninstall the cli extension in 7.4? Would it causes it to default to the 8.1 cli?0 -
What is the default PHP version (in WHM->Software-> MultiPHP Manager)? 0 -
What is the default PHP version (in WHM->Software-> MultiPHP Manager)?
AH! that what changes the default php cli .... Many thanks! php -v PHP 8.1.19 (cli) (built: Jun 6 2023 17:46:08) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.19, Copyright (c) Zend Technologies with Zend OPcache v8.1.19, Copyright (c), by Zend Technologie0
Please sign in to leave a comment.
Comments
4 comments