EDIT 2022-06-20: Cpanel completely removed support for PHP 5.6, so this method no longer works on AlmaLinux 8. If you need PHP 5.6, the best solution is to use CloudLinux, which provides support for older PHP versions. CloudLinux is a popular Linux distro used by many shared hosting providers as it allows for better security and isolates each website to its own virtual file system. You can find more information on cloudlinux at
https://www.cloudlinux.com/os-shared/
Cpanel have removed PHP 7.0 and older version from newer cpanel installations. Existing servers with older version of PHP will continue working.
https://blog.cpanel.com/removal-of-php-5-6-and-php-7-0-in-easyapache-profiles/
If you have a new cpanel server, but required older PHP version for some of your site to work, you can download EasyApache 4 profile from another server and upload to your server and provision it to get older PHP version.
I have EA4 profile with Older PHP version available at
https://gist.githubusercontent.com/serverok/ba144b7f04f0602a369406d7d400c87d
To install, run following commands as root
cd /etc/cpanel/ea4/profiles/custom curl -s https://gist.githubusercontent.com/serverok/ba144b7f04f0602a369406d7d400c87d/raw -o serverok-all-php.json
Or save content of gist https://gist.github.com/serverok/ba97370b3184b480e29cf22c89dc69c3 as serverok-all-php.json, then upload it at
WHM > EasyApache 4 > Upload a profile
Now login to WHM > EasyApache 4, you will see
Click on “Provision” to install older PHP versions.
Related Posts
EasyApache
Reinstall EasyApache4
CloudLinux EasyApache 4 Profile Missing
Cpanel Server
Leave a Reply