Couple of customers have asked us possibility to change domains PHP version in cPanel webhosting account.
NB! differences in PHP versions:
– After 01.05.2023 default PHP version on our servers (instead of 7.4) is PHP 8.1 !
We use on our servers separate PHP versions in which even older versions still get security patches and updates.
You can read more info regarding this on page:
(If Your webpage/script/etc supports newer PHP versions, I would recommend to update Your domain to newest PHP version supported!)
1. Changing PHP version in cPanel
1. Log on to Your cPanel webhosting account
2. Select “MultiPHP manager”
3. Select domain, select required PHP version from dropdown on the right and click “Apply”
(New PHP version will be activated automatically shortly after save)
NB! Mentioned save action will overwrite PHP version in .htaccess file! If You remove/have removed those changes manually, You need to re-apply them!
2. Examples how to run script with required PHP version via command line (Works also via CRON)
Example commands to use with script:
In cron: /bin/ea-php56 /path/to/required/script.php /bin/ea-php70 /path/to/required/script.php /bin/ea-php71 /path/to/required/script.php /bin/ea-php72 /path/to/required/script.php /bin/ea-php73 /path/to/required/script.php /bin/ea-php74 /path/to/required/script.php /bin/ea-php80 /path/to/required/script.php /bin/ea-php81 /path/to/required/script.php /bin/ea-php82 /path/to/required/script.php ---- In command line: ea-php56 /path/to/required/script.php ea-php70 /path/to/required/script.php ea-php71 /path/to/required/script.php ea-php72 /path/to/required/script.php ea-php73 /path/to/required/script.php ea-php74 /path/to/required/script.php ea-php80 /path/to/required/script.php ea-php81 /path/to/required/script.php ea-php82 /path/to/required/script.php
NB! If in required folder or subfolder already has .htaccess file with required PHP version, there is no need to separately give php command exact version, just “php /path/to/required/script.php” will suffice