All possible versions of PHP are installed on the hosting, which you can choose for your site in the management panel.
In order to use the required PHP version in CLI (console) mode for cron jobs, running various PHP scripts, and implementations, you can use the same versions in the console by calling the PHP interpreter of the required version.
php 5.2 - /opt/alt/php52/usr/bin/php
php 5.3 - /opt/alt/php53/usr/bin/php
php 5.4 - /opt/alt/php54/usr/bin/php
php 5.5 - /opt/alt/php55/usr/bin/php
php 5.6 - /opt/alt/php56/usr/bin/php
php 7.0 - /opt/alt/php70/usr/bin/php
php 7.1 - /opt/alt/php71/usr/bin/php
php 7.2 - /opt/alt/php72/usr/bin/php
php 7.3 - /opt/alt/php73/usr/bin/php
php 7.4 - /opt/alt/php74/usr/bin/php
php 8.0 - /opt/alt/php80/usr/bin/php
php 8.1 - /opt/alt/php81/usr/bin/php
php 8.2 - /opt/alt/php82/usr/bin/php
php 8.3 - /opt/alt/php83/usr/bin/php
$HOME — a variable that always points to the root directory of the hosting.
example.com — an example of a site, here you should substitute your own site on the hosting.
script.php — a PHP script for example, you need to substitute the path to your file.
Running the script script.php on the site example.com using php 7.4
/opt/alt/php74/usr/bin/php -f $HOME/www/example.com/script.php
If necessary, to use the ready PHP settings of the site on the hosting, you need to use the -c key to load the .ini configuration file. Useful for cases when you need to run a script with special settings, for example, ionCube extension, which can be enabled for the site in the PHP settings of the hosting.
/opt/alt/php74/usr/bin/php -c $HOME/.system/php/example.com.ini -f $HOME/www/example.com/script.php
If you need to specify or override settings of the .ini file that is used by default, you need to use the -d key.
/opt/alt/php74/usr/bin/php -d memory_limit=256M -d error_reporting=E_ALL -f $HOME/www/example.com/script.php
All question categories