This guide explains how to install old PHP versions on a cPanel/WHM** server running CloudLinux EA4
1. Add the CloudLinux EA4 Repository
First, navigate to the repository directory:
cd /etc/yum.repos.d
Download the CloudLinux EA4 repository configuration file:
wget https://panelwebhosting.com/scripts/php/cloudlinux-ea4.repo
Add the CloudLinux GPG key:
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-CloudLinux https://www.repo.cloudlinux.com/cloudlinux/6/os/x86_64/RPM-GPG-KEY-CloudLinux
2. Install PHP Versions
🔹 Install PHP 5.6 with Required Extensions
dnf install ea-php56-php-{exif,fileinfo,calendar,bcmath,opcache,zip,soap,intl,gd,fpm,mysqlnd,mbstring,sockets,xml,xmlrpc,zip,pdo,imap,gettext,gd,enchant,bcmath,ldap,iconv,imap,process,pgsql,curl,gd} ea-php56-ioncube --enablerepo=cl-ea4
🔹 Install PHP 7.0 – 7.4 with Required Extensions
dnf install ea-php{70,71,72,73,74}-php-{exif,fileinfo,calendar,bcmath,opcache,zip,soap,intl,gd,fpm,mysqlnd,memcached,mbstring,sockets,xml,xmlrpc,zip,pdo,imap,gettext,gd,enchant,bcmath,ldap,iconv,imap,process,pgsql} --enablerepo=cl-ea4
🔹 Install Specific Extensions Separately
dnf install ea-php70-php-curl --enablerepo=cl-ea4 dnf install ea-php74-php-intl
3. Verify Installed PHP Versions
List installed PHP versions:
/opt/cpanel/ea-php*/root/usr/bin/php -v
4. Restart Apache and cPanel to Apply Changes
systemctl restart httpd systemctl restart cpanel
Conclusion
You have now successfully installed old PHP versions on your cPanel/WHM server using CloudLinux EA4. You can manage them via cPanel/WHM (Software > MultiPHP Manager)