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

November 12, 2018 719 views
Ubuntu 16.04 Nginx PHP

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?

1 Answer

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

Have another answer? Share your knowledge.