How to upgrade PHP to v5.5 in Ubuntu 12.04

Posted September 22, 2013 34.2k views
I saw that Zend Opcode is now baked into PHP 5.5 so am keen to apgrade my Virtualmin / LAMP install. Is this relatively easy and how do I go about it (remembering I'm a greenhorn to command line Linux / VPS) Thanks for helping.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

7 answers
Take a look at this post:

Give it a shot and let me know how it goes.
As a newbie, I think I'll pass. It looks decidely un-official and if I get stuck or confused, I don't have enough experience to get myself out of trouble :)
Thanks anyway Kamal

Why not:

1.) take a snapshot of your droplet;
2.) spin up a new droplet from that snapshot;
3.) try upgrading to PHP v5.5;
4.) if all goes well, follow the same steps on your original droplet; then
5.) destroy the newer droplet?
  • This is precisely what I do and recommend. I would add, that you should then take a look at your users (probably root) bash history file and edit that accordingly to make the processes essentially a nice bash script. Should be located at: /root/.bash_history
Use the dotdeb repository which includes PHP 5.5
I don't think you can install a Debian Wheezy/Squeeze/etc repo on Ubuntu, however the guy that maintains also maintains an Ubuntu PPA with the same packages:

I followed the instructions at and the only hiccup I found was that by default PHP was disabled in user home directories, where my document root happened to be. Commenting out that block in /etc/apache2/mods-available/php5.conf fixed it for me.

I was able to update to PHP 5.5 following the instructions on But by upgrading to Apache 2.4, the config file got overwritten. And I didn’t know what to change to keep it working.

Luckily, I took a Snapshot before upgrading and then I restored from Snapshot. So everything’s back to normal now.

Submit an Answer