Ubuntu 12.04 - Upgrade PHP 5.3.10 to PHP 5.4
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 (
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
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.
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.
Doing the upgrade on a new linode seems like a sensible thing to do now.