downgrade php5 5.5.3 to php5 5.3 in ubuntu 13.10

17,415

Solution 1

I think best solution for now (and future too) is Vagrant. Vagrant can make lightweight, reproducible, and portable development environments. All what you need is in Ubuntu software center. So installation is very easy.

In next step you need vagrant boxies with your dev environments. Go to https://puphpet.com/ and configure box what you need (ex. PHP 5.3) and download. Vagrant box run with this command

vagrant up <box file name>

Solution 2

  1. Ondrej php5-oldstable packages, would be a good option, but at the moment they don't work on Saucy Salamander (debphp.org/ubuntu-saucy-support.html). You could just wait.
  2. You can compile PHP on your own.
  3. Easy solution would be to temporarly switch to old (raring) repositories, install PHP (5.4), Apache (2.2), etc and lock package versions (so it won't be upgraded anymore):

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`

Solution 3

debian has an easy method to this problem. And it more than likely would work for ubuntu. you open the older repository in sources.list and pin the package desired and give it a higher Priority and it will pull those packages on the list that u need. documentation here , http://www.leonli.co.uk/blog/debian-7-0-wheezy-php-5-3-install-downgrade-from-php5-4/.

Share:
17,415

Related videos on Youtube

Kmelkon
Author by

Kmelkon

Junior web developer. Android enthusiast since 2011. currently I'm starting to learn how to develop android apps. My device(s): HTC One (32GB international)

Updated on September 18, 2022

Comments

  • Kmelkon
    Kmelkon almost 2 years

    I just upgraded to ubuntu 13.10.. I was working on a project that uses php 5.3 and now phpmyadmin is not working and when i try to open a page i see a ton of warning and the sign in page doesnt sign me in.. how can I downgrade ? I tried removing php and phpmyadmin and re-installing but nothing happened. this is what i get when i try php-v

    PHP 5.5.3-1ubuntu2 (cli) (built: Oct 9 2013 14:49:12) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

  • Kmelkon
    Kmelkon over 10 years
    thank you for the response and sorry about the late reply but I had to fix the problem as fast as I can so I dual booted Ubuntu 13.10 with 13.04 this sounds like a dumb solution but it was all I could come up with after I wasted a couple of hours, guess I'll try your solution next time, since eventually I have to move to 13.10..
  • Kmelkon
    Kmelkon over 10 years
    nice! this seems like a viable solution although for the time being I'm dual-booting, guess I'll have to give this a try. thanks a lot
  • Braiam
    Braiam over 10 years
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.