Report this

What is the reason for this report?

How to upgrade from PHP 5.5.9 to PHP 5.6 on Ubuntu 16.04 with Nginx 1.4.6

Posted on November 12, 2018

I need to add some composer packages to my site that require PHP 5.6, so how can I upgrade from PHP 5.5.9 to PHP 5.6 on Ubuntu 16.04 with Nginx 1.4.6 as a server?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @mbasfour,

There is no out of the box way to upgrade PHP versions. What you need to do is just install the higher version.

In your case, you can do the following to enable PPA for PHP 5.6 in your Ubuntu system and install PHP 5.6.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php5.6

Since you are using Nginx, you might need to install

sudo apt-get install php5.6-fpm php5.6-mysql 

As well.

Regards, KDsys

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.