CyberPanel only install LiteSpeed PHPs from LiteSpeed repos. Installation directory for PHP is located at
/usr/local/lsws/lsphpXX
You need to replace XX in the path above with PHP version, for example the path for PHP version 7.4 is /usr/local/lsws/lsphp74
And PHP CLI binary path for each PHP version is
/usr/local/lsws/lsphpXX/bin/php
So PHP binary path for PHP 7.4 is /usr/local/lsws/lsphp74/bin/php
During installation CyberPanel installation code runs following command to set Global PHP CLI:
ln -sfn /usr/local/lsws/lsphp74/bin/php /usr/bin/php
Which means by default the Global PHP for CLI is 7.4, upon running php -v on command line you will get:
root@ip-172-31-34-208:~# php -v
PHP 7.4.16 (cli) (built: Mar 4 2021 16:36:45) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
root@ip-172-31-34-208:~#
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 8.2
ln -sfn /usr/local/lsws/lsphp82/bin/php /usr/bin/php
Set Command line to PHP 8.1
ln -sfn /usr/local/lsws/lsphp81/bin/php /usr/bin/php
etc…
How to use specific PHP Version in your Cron Jobs?
Some applications requires you to set cron jobs and they require PHP CLI executable. Now rather then changing default global php binary version, you can use direct path to that CLI.
For example an application requires that its script should be running through PHP 7.2, you can use the direct path for its binary rather then updating a global binary, such as
/usr/local/lsws/lsphp81/bin/php <your command goes here>