Ubuntu 12.04 - Upgrade PHP 5.3.10 to PHP 5.4

Hello,

I am running Ubuntu 12.04 LTS: PHP Version 5.3.10-1ubuntu3.9

I tried to install a PHP application today and it error'd out citing php 5.3 as the only issue. I already have my VPS set up and I would hate to break anything. I followed this guide (http://www.howtoforge.com/perfect-serve … spconfig-3">http://www.howtoforge.com/perfect-server-ubuntu-12.04-lts-apache2-bind-dovecot-ispconfig-3) during setup (ISPConfig 3) and I also have webmin installed.

I want to update to PHP 5.4 and I want a safe method to do this (preferably one with instructions to backup) without complicating my setup.

Can you point me in the right direction?

3 Replies

If I needed a newer PHP than 5.3 I would probably just go with a newer Ubuntu release. Ubuntu 13.10 ships with PHP 5.5.x. In a few months there will be a Long Term Support release (14.04) with PHP 5.5.x.

You would probably want to start from scratch however, as quite a bit of apache and php stuff changed in Ubuntu 13.10. But considering having to support custom versions of PHP is pretty painful (security, broken reverse dependencies, upgrades, trustworthiness of your 3rd party package source if going that route..), its probably still worth it, IMHO.

There is a PPA for PHP 5.5 here: https://launchpad.net/~ondrej/+archive/php5

The safest route to follow would be:

  • Enable backups (if not already) and make a snapshot of your linode;

  • Spin up a new linode and restore the snapshot to it;

  • On the new linode, experiment with upgrading PHP.

After a successful upgrade and when everything checks out OK you can either:

  • Swap IPs, and make the new linode your production server. Though if you have dynamic sites watch out you don't lose any new data accumulated during the testing period;

  • Or, repeat the upgrade process on your production box if you feel confident.

Then cancel the extra linode and the balance will be credited to your account. So it will cost you very little overall.

Thank you, Trippeh and Sleddog for your replies.

Doing the upgrade on a new linode seems like a sensible thing to do now.

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