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 newsletter to stay up to date with our latest content.

More Content by Liquid Web
Previous Video
How To Easily Create Content That Converts In 30 Days
How To Easily Create Content That Converts In 30 Days

Find out how to create a purpose-driven content strategy that converts to more leads and sales, including a...

Next Video
Cybersecurity Tip - Login Credentials and Contractors
Cybersecurity Tip - Login Credentials and Contractors

Since the primary account holder for websites typically isn't dealing with the technical side, they may con...

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

Download Now