Install Multiple PHP Versions on Ubuntu 16.04

October 4, 2019 Liquid Web

In this video, we will be discussing how to install Multiple PHP Versions on Ubuntu 16.04. Ubuntu 16.04 LTS servers assign the PHP 7.0 version by default. Although PHP 5.6 is currently EOL (end of life) as of December of 2018, some applications may not be compatible with PHP 7.0. For this tutorial, we will instruct you on how to switch between PHP 7.0 and PHP 5.6 for Apache and the overall default PHP version for Ubuntu.

Commands Used: 
apt-get update -y.
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php -y
apt-get update
apt-get install -y php5.6
a2dismod php7.0; a2enmod php5.6; systemctl restart apache2
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
curl -s http://localhost/phpinfo.php | grep "PHP Version" | tail -1
update-alternatives --config php
php -v

The related article for this article can be found here: 
https://www.liquidweb.com/kb/install-multiple-php-versions-on-ubuntu-16-04/

For more information about this and other topics, visit us at https://www.liquidweb.com/kb/
To learn more about our managed woocommerce hosting, visit: *https://www.liquidweb.com/products/managed-woocommerce-hosting/"


Video by: Justin Palmer

About the Author

Liquid Web

Liquid Web powers online content, commerce, and potential for SMB entrepreneurs and the designers, developers and digital agencies who create for them. Sign up for our <a href="https://www.liquidweb.com/blog">newsletter</a> to stay up to date with our latest content.

More Content by Liquid Web
Previous Video
How To Enable The EPEL Repository On CentOS
How To Enable The EPEL Repository On CentOS

In this video, we describe how to add the EPE: repository. The EPEL repository is an additional package rep...

Next Video
How To Install and Configure SNMP on CentOS
How To Install and Configure SNMP on CentOS

In this video, we demonstrate to you how to do setup SNMP or Simple Network Management Protocol. SNMP is wi...

Learn What Qualities to Look for in Your Next Host in Our New Guide!

Download Now