Recently I upgraded PHP to 5.4, but it seems to be failing on me because APC isn't working with it, however this gave me no choice but to downgrade to 5.3, how can I do this?
I executed apt-get remove php5
and apt-get purge php5
then I removed the 5.4 repo from apt-get then executed apt-get install php5
, it says it was installing 5.3, and I restarted php-fastcgi
and php5-fpm
but when I run php -v
it says 5.4.
How can I downgrade from 5.4 to 5.3?
My server is running Ubuntu 11.04.
Best Answer
Downgrading PHP 5.4 to 5.3
In Ubuntu downgrading process is a really mess. Here is the script which you could find it useful (it removes PHP 5.4 and install PHP 5.3):
Where the available versions you can check by command:
apt-cache showpkg php5
After the installation, verify it by command:
php --version
Please be careful and don't install any other packages without package version specified (like php5-xcache), otherwise apt-get will replace your PHP instance with 5.4 again!
To prevent this happening, you can hold these packages.
Holding packages using dpkg
To hold packages by dpkg, you can execute the following command:
To hold all PHP packages, run the following command:
The following command will show you holding status of your php packages:
Holding packages using aptitude
You can also hold packages using aptitude e.g.:
Unhold: