You should already have Apache installed and serving web pages before following this guide.
For this tutorial, we are using the PHP 5.6, PHP 7.0/7.1/7.2 and PHP 7.3 to configure with Apache web server and system. To use the multiple PHP versions, we will use PHP FPM and FastCGI. Let’s install the following packages on your system. You can change the php version name as per your need during installtion
Step 1. Add Repository and required packages
Let’s begin by updating the package lists.
sudo apt update
For Ubuntu 20.04 and 18.04 users, installlibapache2-mod-fcgid.
For Ubuntu 16.04 users, installlibapache2-mod-fastcgi.
Step 5: Finally, verify your default PHP version used on your system like this.
sudo php -v
Step 6: To set the PHP version that will work with Apache web server, use the commands below.
Example: Switch From PHP 5.6 => PHP 7.2
sudo a2dismod php5.6 #disable current versionsudo a2enmod php7.2 #enable the version that requiredsudo service apache2 restart #apache restart required
To verify the php version create the info.php file in /var/www/html location or a documentroot of a website.
Place the below code inside the info.php file and save it.
<?php phpinfo(); ?>
Hit the url in browser ex:http://your_domain_name.com/info.php
Step 7: You can set the default PHP version to be used on the system with the update-alternatives command, after setting it, check the PHP version to confirm as follows.
I was suggested this blog by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. Iseabal Sigfried Jaeger
Hi there. I discovered your blog by the use of Google whilst looking for a comparable topic, your site came up. It seems to be great. I have bookmarked it in my google bookmarks to come back then. Suzanne Hernando Stenger
dublaj
Hello. This article was really remarkable, especially because I was browsing for thoughts on this matter last Monday. Andee Tome Maida
online
Brilliant. Thank you. I love it when a lightbulb moment is shared Gabbi Alvie Church
turkce
I was suggested this blog by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. Iseabal Sigfried Jaeger
turkce
Wonderful article! We will be linking to this particularly great content on our website. Keep up the great writing. Judith Davidde Brockwell
turkce
Thanks a lot for the post. Really thank you! Much obliged. Gladys Tann Allianora
erotik
Dead written written content , appreciate it for selective information . Mariana Portie Barcellona
샌즈카지노
As I website owner I believe the content material here is very superb, thanks for your efforts. Pollyanna Willi Dollie Jo-Ann Vinny Edme
erotik
Hi there. I discovered your blog by the use of Google whilst looking for a comparable topic, your site came up. It seems to be great. I have bookmarked it in my google bookmarks to come back then. Suzanne Hernando Stenger
Williams
I like the helpful information you provide in your articles.
I will bookmark your blog and check again here regularly. I’m quite certain I’ll learn many new stuff right
here! Best of luck for the next!
Arianne
This post is really a pleasant one it helps new the web users, who are wishing for blogging.
Mikayla
Hello There. I found your weblog the usage of msn. This is a very smartly written article.
I’ll be sure to bookmark it and come back to learn extra of your helpful info.
Thanks for the post. I’ll certainly return.