Master da Web
Back to Blog

Installing PHP 5.6 on Ubuntu 14.04, 16.04 and 17.04

LucasJune 15, 20181 min readUpdated on November 4, 2023
Installing PHP 5.6 on Ubuntu 14.04, 16.04 and 17.04

Installing PHP 5.6 on Ubuntu 14.x, Ubuntu 16.x and Ubuntu 17.x has become easy, thanks to the ondrej/php repository (https://launchpad.net/~ondrej).

How to install PHP 5.6 on Ubuntu 14.x, Ubuntu 16.x and Ubuntu 17.x ?

To install PHP 5.6, simply execute the following sequence of commands:

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

Note that if you want to install PHP 7.x, for example, all you have to do is change the php5.6 argument in the command to php7.0, php7.1 and so on…

To switch the version between PHP 5.6 and PHP 7.0:

a2dismod php5.6
a2enmod php7.0
service apache2 restart

 

Tags#PHP#ubuntu
Share

Need Hosting or Servers?

Discover our VPS, dedicated servers and professional hosting solutions

Related Articles

View all articles