9

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).

4
  • I will save you the headaches and tell you just to install 12.04 instead.
    – Braiam
    Apr 26, 2014 at 3:22
  • There are more options: 1. install 12.04 in vBox and use vB from there. 2. dual boot with 12.04. 3. ditch vBulletin ;)
    – Rinzwind
    Apr 26, 2014 at 5:26
  • discourse.org is so much better...
    – hayd
    Apr 30, 2014 at 17:32
  • If downgrading to 5.4 using the commands above, what prevents ubuntu 14.04 from updating it when it finds the new version?
    – musicweb
    Mar 6, 2015 at 16:06

4 Answers 4

5

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

3
  • That seems messy, how well does a mixed 12.04/14.04 system work in practice? Have you done this yourself? Feb 2, 2015 at 12:38
  • 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. Nov 9, 2015 at 0:53
  • 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 :)
    – Jorj
    Nov 10, 2015 at 9:57
1

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.

0

I don't use vBulletin to be honest but in other CMS you can specify the php version in the .htaccess file using a handler with the form :

AddHandler application/x-httpd-php54 .php (for 5.4)

That is the case that 5.4 is also in your computer . I hope we are still discussing the same subject .

0

you can use both php versions parallel using fastcgi.

http://www.jabommi.de/wiki/downgrade-php-5-5-to-5-3-ubuntu-14-with-multiple-php-versions/

Not the answer you're looking for? Browse other questions tagged .