Home > Article > Backend Development > How to deploy multiple versions of PHP on the Pagoda panel at the same time
Pagoda Panel is a very convenient server management panel that can install a variety of software, including multiple versions of PHP. However, sometimes, we need to deploy multiple versions of PHP at the same time, what should we do in this case? This article will introduce how to deploy multiple versions of PHP on the Pagoda panel at the same time.
Step One: Install Pagoda Panel
If you have already installed Pagoda Panel, you can skip this step. If you have not installed the Pagoda panel, you can use the following command to install it on your server:
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
After the installation is complete, you can enter your IP address or domain name in the browser to access the panel, and enter the user in the interface Create an administrator account with a name and password.
Step 2: Install multiple versions of PHP
It is very easy to install multiple versions of PHP in the Pagoda panel. After opening the panel, click [Software Store] → [PHP]. On this page, you can see the multiple PHP versions available. Each version has an install button that can be clicked to install that version of PHP.
Step 3: Set up virtual host
By default, Pagoda Panel only supports the use of one version of PHP on each website. If you need to use multiple PHP versions on the same website at the same time, you need to set up a virtual host to achieve the purpose.
After opening the Pagoda panel, click [Website] → [Add Site]. In the "Site Settings" page, set the "PHP Version" to the PHP version you need to use. Next, click the "Add Virtual Host" button to add the website domain name and port to the virtual host list.
Repeat the above steps to add all websites that need to use multiple PHP versions.
Step 4: Set environment variables
When deploying multiple versions of PHP, you may encounter some environment variable problems. In order to solve this problem, we need to manually add environment variables in the Pagoda panel.
After opening the Pagoda panel, click [Website] → [Settings] and select the "Process Management" tab. On this page, you can see all currently running processes. Add the following in the "Environment Variables" field:
PATH=$PATH:/usr/bin/php-cgi7.3:/usr/bin/php-cgi7.2:/usr/bin/php-cgi7.1:/usr/bin/php-cgi7.0:/usr/bin/php-cgi5.6:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/php/sbin:/usr/local/php/bin:/usr/local/mysql/bin:/usr/local/php/php-fpm.d
This environment variable will contain all installed PHP versions so that they can run smoothly on the server.
Step 5: Restart the server
After completing the above steps, you need to restart the server for all changes to take effect. Enter the following command to restart the server:
reboot
Wait a few minutes and your server will restart and apply all changes.
Summary
When using the Pagoda Panel, deploying multiple versions of PHP at the same time is not a very difficult task. Just follow the above steps and you can easily deploy multiple PHP versions on your server and use them in your website.
The above is the detailed content of How to deploy multiple versions of PHP on the Pagoda panel at the same time. For more information, please follow other related articles on the PHP Chinese website!