How to Change CLI PHP on CyberPanel?
Posted: Mon Apr 07, 2025 8:56 pm
How you can change the default version of PHP on CLI?
If you have certain needs and PHP 7.4 does not work for certain application you can run following command to update the default PHP on CLI.
Set Command line to PHP 7.3
Set Command line to PHP 7.4
Set Command line to PHP 8.0
Set Command line to PHP 8.1
Set Command line to PHP 8.2
we make a little test on CLI to Confirm the change with this command and the answer is going to show the version
If you have certain needs and PHP 7.4 does not work for certain application you can run following command to update the default PHP on CLI.
Set Command line to PHP 7.3
Code: Select all
ln -sfn /usr/local/lsws/lsphp7.3/bin/php /usr/bin/phpCode: Select all
ln -sfn /usr/local/lsws/lsphp74/bin/php /usr/bin/phpCode: Select all
ln -sfn /usr/local/lsws/lsphp80/bin/php /usr/bin/phpCode: Select all
ln -sfn /usr/local/lsws/lsphp81/bin/php /usr/bin/phpCode: Select all
ln -sfn /usr/local/lsws/lsphp82/bin/php /usr/bin/phpCode: Select all
# php -v
PHP 8.2.24 (cli) (built: Sep 24 2024 22:12:40) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.24, Copyright (c) Zend Technologies
with Zend OPcache v8.2.24, Copyright (c), by Zend Technologies