PHP 5.2 was removed from EasyApache due to its End of Life status. You can read about that here.
While downgrading to PHP 5.2 is not advised and is really kind of a terrible idea (given that 5.2 has been End of Life for years), cPanel provided some documentation on a way to downgrade PHP to this unsupported and end of life version here.
As outlined in that documentation you should run these commands on your server:
cd /var/cpanel/easy/apache/custom_opt_mods/
wget http://docs.cpanel.net/twiki/pub/EasyApache/EasyApacheCustomModules/custom_opt_mod-PHP5217.tar.gz
tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf custom_opt_mod-PHP5217.tar.gz
Then recompile Apache using EasyApache. If you want no php except 5.2 then on the ‘PHP Version’ screen chose ‘none’, and continue. On step 4, the ‘Short Options List’ page you will see ‘PHP 5.2.17 support (no FastCGI)’ listed. Check that box and continue your EasyApache like normal.
really you save my time by this blog.
I were confused how to downgrade the php using easyapache to php5.2 to support some old software.
but after reading this blog I found the solution.
I tried it and its working perfect.
Thanks a lot.
So glad I could help!
Hi its impossible to unzip this file. Do you have any idea ?
I was able to extract it without errors. Can you tell me what error you’re seeing?
[code]river:Downloads benny$ tar -xvf custom_opt_mod-frontpage-20140912.tar.gz
x Cpanel/
x Cpanel/Easy/
x Cpanel/Easy/Apache/
x Cpanel/Easy/Apache/FpOptMod.pm.tar.gz
x Cpanel/Easy/Apache/2_2/
x Cpanel/Easy/Apache/2_2/FpOptMod.pm
x Cpanel/Easy/Apache/FpOptMod.pm
x Cpanel/Easy/Apache/2_4/
x Cpanel/Easy/Apache/2_4/FpOptMod.pm
river:Downloads benny$ [/code]
Oh! It looks like they changed the link. You should visit this page and click the ‘Download” link, next to the FrontPage module.
https://documentation.cpanel.net/display/EA/Custom+Modules
Thank you ! I found the way to do it. I downloaded with my Windows PC and uploaded it to my server.
When I used wget the file was to small and not recognized as a gzip file.
So it worked for me the downgrade to 5.2.
have a nice day
Klaus
Glad you got it worked out!
Hello,
We have followed the steps given above to downgrade php version to 5.2.17 and recompiled apache. Also, we have restarted httpd service. But the PHP version still showing as 5.4.x. Also, we have tried the steps mentioned in the URL “http://syslint.com/syslint/how-to-install-php-5-2-on-cpanelwhm-11-40/”
But the problem still occurs. Do you have any idea on this? Please reply.
Hi there! What version of WHM are you using, and were there any errors during your recompile? You can check the logs in /usr/local/cpanel/logs/easy/apache if you aren’t sure.