PHP CLI version is the version of PHP that is used to run PHP scripts in the command line interface (CLI) of your server. This is sometimes different from the PHP version that is used to run PHP scripts in the web server (such as Apache or Nginx).

You can check your PHP-CLI version by running the following command:

php -v

To see all of the PHP versions available on your Nginx server, execute the following command:

find /RunCloud/Packages/php* -name php -type f

The above command will generate a list of all the PHP versions available on your server, with the absolute path for each. To use a specific version of PHP, use its absolute path instead of php.

For instance, if you want to make sure that your script is using PHP 8.2 instead of the default PHP version, then replace php with the absolute path of PHP 8.2.

In the above screenshot we can see that the server has four different versions of PHP. When we execute php -v, our server uses PHP 7.4.

However, when we specify the complete path (/RunCloud/Packages/php82rc/bin/php) then it uses PHP 8.2.

Changing PHP CLI Version

The PHP CLI Version can affect the functionality and compatibility of some PHP applications that rely on the CLI, such as Composer, Cron, or Supervisord.

You can change the PHP Cli Version of your RunCloud server by going to the Settings page and selecting the PHP Cli Version section. You will see a list of available PHP versions that are installed on your server, from which you can choose the PHP version that you want to use as the default version for the CLI by selecting it from the dropdown menu.

Note: If you have any problem running Composer or PHP in the CLI, you may need to run SSH as interactive mode. This will ensure that the correct PHP path is loaded for the CLI. To do this, you can run the command source /etc/profile.d/runcloudpath.sh in the terminal. This will load the RunCloud path settings for the CLI.