You can run the command by providing the path of the PHP used in your account. This way you will run your script using the specific path of the desired version.

Example for PHP 7.1:

/opt/cpanel/ea-php71/root/usr/bin/php

You can also change PHP settings during this execution.

To do so, you must use the -c or -d parameter

-c <path>|<file> Look for php.ini file in this directory
-d foo[=bar] Define INI entry foo with value 'bar'

This way you will be able to run:

/opt/cpanel/ea-php71/root/usr/bin/php -c /path/to/file.ini
or
/opt/cpanel/ea-php71/root/usr/bin/php -d allow_url_fopen=1

You can check in your cPanel which PHP versions are available in MultiPHP Selector. This way you won't be limited to using the system PHP in the CLI.

If you need any help, our support team is at your disposal.

Was this answer helpful? 97 Users Found This Useful (292 Votes)