![]() This website is configured to work with PHP 8.1.īoth of the websites are configured now. Make sure to use the correct ServerName and directory path according to your setup. sudo vim /etc/apache2/sites-available/Īdd the following content. Create a file for the first virtual host and edit in your favorite text editor. Apache keeps all the VirtualHost configuration files under /etc/apache2/sites-available with the extension. sudo mkdir /var/echo "" | sudo tee -a /var/Let’s start the creation of VirtualHost. First, create two directories on your server. For the testing purpose, I am configuring two websites to work with two different-2 PHP versions. Get ready for the configuration of websites on your Apache server. You may like: How to Enable/Disable PHP Modules on Ubuntu.Use the following commands to make sure both services are running. sudo apt updateĪfter installation, php-fpm services will be started automatically. Let’s install the following packages on your system. To use the multiple PHP versions, we will use PHP FPM and FastCGI. ![]() sudo apt install software-properties-commonįor this tutorial, we are using PHP 8.1 and PHP 7.4 to configure with the Apache webserver. Use the below couple of commands to add the PPA to your system. sudo a2enmod actions fcgid alias proxy_fcgiįor the installation of PHP versions, we use the PPA maintained here. These modules are necessary to integrate PHP FPM and FastCGI with the Apache server. Now enable a few modules required for the configuration of multiple PHP versions with Apache. Sudo apt install apache2 libapache2-mod-fcgid Execute the following commands to install the latest available version of the Apache webserver. Launch terminal on your system or login with ssh for remote systems. Install Apache web server from the official repository. You can also use more than two PHP versions with Apache as required but this tutorial covers two only. First VirtualHost will work with PHP 8.1 and another VirtualHost will run with PHP 7.4. This tutorial describes the installation and configuration of two VirtualHost on Apache with separate PHP versions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |