Downgrade PHP Version from 5.5 to 5.4 on Ubuntu 14.04

38,795

Solution 1

Install Apache+fcgid+php5.4

sudo apt-get update
sudo apt-get upgrade
sudo apt-get remove --purge `dpkg -l | grep php | grep -w 5.5 | awk '{print $2}' | xargs`
sudo apt-get purge apache2 php5 libapache2-mod-php5
sudo sed -i.bak "s/trusty/precise/g" /etc/apt/sources.list
sudo apt-get update
sudo apt-get install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi
sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xdebug
sudo sed -i "s/precise/trusty/g" /etc/apt/sources.list
dpkg --get-selections | egrep '^(apache|php)' | sed 's/install/hold/g' | sudo dpkg --set-selections
sudo apt-get update
sudo apt-get install  mysql-client mysql-server phpmyadmin

Then continue setting up the environment as here: http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-ubuntu-12.04

Solution 2

There is plenty of options around which @Braiam & @Rinzwind mentioned in comments

Also as a workaround you may want to Check Phpbrew
as it says :

phpbrew builds and installs multiple version php(s) in your $HOME directory.

phpbrew also manage the environment variables, so you can use, switch php version whenever you need.

Share:
38,795

Related videos on Youtube

Clarice
Author by

Clarice

Updated on September 18, 2022

Comments

  • Clarice
    Clarice almost 2 years

    First time I've ever needed to ask a question here that I don't think has already been answered.

    I've recently been working on transferring over a vBulletin site I run to a new server. Thinking that I was being all ahead of the curve, when I went to install Ubuntu on it recently and saw 14.04 was available, I went for it.

    As I should have expected, it's a nightmare. Turns out that vBulletin JUST added support for PHP 5.4 with their last release on the version I run. I honestly don't expect them to ever get it up to PHP 5.5 (what 14.04 installs by default).

    Save from going back to 12.04 LTS and starting completely over, is there a way I can downgrade the PHP version installed to 5.4? I saw some threads talking about this for going from 5.4 to 5.3, so I'm hoping its doable.

    The simpler you can help me to do this, if possible, the better. I know my way around, but by no means consider myself an expert. Thanks!

    EDIT: For clarity. Need to downgrade PHP from 5.5 to 5.4 on 14.04 (Trusty Tahr).

    • Rinzwind
      Rinzwind about 10 years
      There are more options: 1. install 12.04 in vBox and use vB from there. 2. dual boot with 12.04. 3. ditch vBulletin ;)
    • hayd
      hayd about 10 years
      discourse.org is so much better...
  • thomasrutter
    thomasrutter over 9 years
    That seems messy, how well does a mixed 12.04/14.04 system work in practice? Have you done this yourself?
  • Abhishek Madhani
    Abhishek Madhani over 8 years
    Damit you, just post what the OP asked for only PHP. He didn't asked for Apache and FCGID, You messed up my whole system.
  • Jorj
    Jorj over 8 years
    Actually it is you who messed your system. The answer clearly states what it will install. The statements includes clearly references to Apache which you can just take them out if you do not want them. But look at the bright side: you have now the best environment possible :)