During the update from Ubuntu 13.04 to 13.10, PHP was upgraded to 5.5.3.
How can I downgrade to 5.4.x?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Please consider it as a risky operation, as you might loose your settings and break your system. I did not test all the lines, so please tell me if I have to adjust something
# upgrade system, so you can add to ignore all updates later sudo apt-get update sudo apt-get upgrade # remove your php, apache, etc sudo apt-get purge apache2 php5 libapache2-mod-php5 # add here your server packages # change repositories to raring (with backup) sudo sed -i.bak "s/saucy/raring/g" /etc/apt/sources.list # update and install server packages sudo apt-get update sudo apt-get install apache2 php5 libapache2-mod-php5 phpmyadmin #add here packages you need and make sure you install php5.4 and apache2.2 # change repositories back to saucy sudo sed -i "s/raring/saucy/g" /etc/apt/sources.list # ignore all current upgrades (package hold) sudo apt-mark hold `aptitude -F%p --disable-columns search ~U`
I was able to get this working on 13.10 by using PHPBrew - https://github.com/c9s/phpbrew
Once you get PHPBrew up and running I had to install APXS with:
sudo apt-get install apache2-threaded-dev
Then I was able to execute the following PHPBrew command:
sudo phpbrew install php-5.4.20 +mysql+apxs2-/user/bin/apxs
It is the apxs2 parameter that allows PHPBrew to create a new php5.load file for Apache (your current one is backed up) which references a new php5_module file /usr/lib/apache2/modules/libphp5.4.20.so
The final step for me to get MySQL up and running was to edit the new php.ini file - located where PHPBrew intalls the new php-5.4.20 source, and explicitly call the mysqld.sock file. For some reason this wasn't working out of the box for me.
Hopefully these steps help someone else looking to downgrade from PHP 5.5 on Ubuntu 13.10
Current stable is php 5.5. You are looking for php 5.4 "old stable".
Try looking at this website and using the following ppa:
You have a complete answer on how to downgrade and hold the package on askubuntu:
https://askubuntu.com/a/220086/5538 -- It's for php 5.4 to 5.3, but it's the same procedure.