In linux, php7 and php5 are run simultaneously, and php7, php5, and php7php5 are installed simultaneously.
Although php7 performs much better than php5,
It has been out for more than two years,
However, many old systems are developed using php5,
Directly transplanted to php7,
There will be many problems.
The old system is not developed by you,
So sometimes upgrading and modifying the old system,
Content cannot be implemented in a short time.
In this case, you need,
Install php7 and php5 at the same time,
Let the old system request php5,
New Service Request php7.
1. Install php7 and php5 simultaneously in linux
The installation of php5 is similar to that of php7,
For more information, see php7 installation in linux.
2. Install php7 and php5 at the same time,
2-1) do not install the two php files in the same directory.
In the php7 tutorial, install php7 to/usr/local/php,
When installing php5,
Do not overwrite the above content,
You can choose to install to/usr/local/php5
2-2) Use their respective php. ini configuration files
In the PHP 7 tutorial,
Php-fpm uses the/etc/php. ini configuration file,
Php5 can put the configuration file in the/usr/local/php5/etc/directory.
2-3) install their respective php extensions
Otherwise,
For example, although we have installed the memcache extension of php7 in php7,
But it cannot be used in php5,
The error message "memcache. so" is not found.
It must be installed separately.
3. Run php7 and php5 simultaneously in linux
In essence, two php-fpm instances are run in linux,
Note:
Both php-fpm Use php. ini and php-fmp.conf respectively.
In linux, besides php7 and php5,
It is also necessary for nginx to resolve different domain names to the corresponding php program.
Instructor Jia ziheng's public account's sexiness note
2php reply
View how to run php7 and php5 simultaneously in linux,
Understand nginx configuration parsing.