Installing older MySQL and PHP

I just fired up a linode, and used the LAMP StackScript. That installed MySQL 5.1.47 and PHP 5.3.2.

Is there an easy way to install previous versions, say 5.0.27 and 5.2.6? (some parameter to apt-get)?

Or am I going to have to hunt down a distribution myself and pray that all the dependencies are installed already?

8 Replies

If you want those specific versions you can try googling for a deb or compile it yourself.

If you just want mysql 5.0.x and php 5.2.x try ubuntu hardy or karmic.

Generally speaking, you get whatever version the maintainers of the Linux distribution choose to package. With Ubuntu, that will be (roughly) the latest version available on the release date. This isn't a problem for 99% of the software out there, but since PHP is a unique and special butterfly, some problems may ensue.

My favorite method of working around it is to use apt's pinning function to pull in PHP from the previous release of Ubuntu (9.10): http://blog.hoopycat.com/2010/07/runnin … -10-04-lts">http://blog.hoopycat.com/2010/07/running-php-5-2-on-ubuntu-10-04-lts

This seems to work out OK, since the libraries and other software PHP relies on don't have this reverse-incompatibility problem, and the 9.10 package seems to work just fine under 10.04 :-)

However, there's other ways that work as well… you can uninstall the existing PHP stuff and compile from source, use a third-party PPA, or use some other method. Each of these have their advantages and disadvantages. My primary motivation for choosing the pinning method was to keep updates simple, in the unlikely(*) event of a security issue in the PHP packages.

(*) That was sarcasm

Use Ubuntu 8.04 LTS (Hardy), which will continue to get security updates for another 3 years. Or Debian 5.0 (Lenny), which is super stable. Both are packaged with MySQL 5.0.x and PHP 5.2.x. Debian, in particular, has lots of new packages in their backports repository so you won't be missing out on newer versions of other software.

@hybinet:

Use Ubuntu 8.04 LTS (Hardy), which will continue to get security updates for another 3 years.

Thanks for all the help, guys!

So if I torch my linode and rebuild it, will the LAMP stack script install the 5.0 MySQL and 5.2 PHP? That is, does the 8.04 by design stay pinned to 5.0/5.2, or will it try to install the latest and (not so) greatest

Or should I just pick the 8.04 OS but install stuff myself? (Heh…. talk about a leading question).

Sorry about the newb-tastic questions, the last time I did this was over four years ago, and that time, my dedicated box came pre-loaded and I didn't touch the MySQL/PHP sub-systems.

If the Stack Script says it's based on 8.04, you'll probably get the versions you want. The latest versions simply aren't available for 8.04 unless you manually enable backports and other stuff. Just check everything after installation is finished. If it doesn't work, or if you can't find the right Stack Script, you can always start with an empty 8.04 image and apt-get install php5 etc.

@hybinet:

you can always start with an empty 8.04 image and apt-get install php5 etc.

Right. I'd prefer (for now) not to do that, if there's a StackScript that will do that for me. Because that way, my list of "things to do after booting", like "add users, lock down ssh, disable ports, install my apps" is shorter.

But that was really the root of my question:

f I install 10.04 and do apt-get install php5, does it install and stay at 5.3.2, while 8.04 installs and stays at 5.2?

It should stay at the major release (5.2.x, 5.3.x, etc), but it may increase the minor release (5.3.2 -> 5.3.3), I believe.

Ubuntu usually keeps the minor version number as well, but makes changes to the part after the hyphen. For example, 8.04 currently ships with PHP 5.2.4-2ubuntu5.10. It's 5.2.4 all right, but the part after the hyphen has changed a few times in the 2 years since 8.04 was released. The changes usually consist of security fixes backported from newer releases of PHP.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct