PHP developers often encounter this situation, the development of the language is sometimes 5.3, sometimes 5.6. You can't always reinstall PHP every time you switch versions.
Fortunately there is a solution, that is, in the system to compile multiple versions of PHP, in the switch only need to modify the shortcut on it.
First, multiple versions of PHP are compiled in the system to handle different environments.
Want to switch the PHP version of the system. There are several places that need to be changed respectively. PHP version used in HTTP
The general Nginx is to use PHP-FPM to run PHP, so you need to add the correct php-fpm to/ETC/RC.D/INIT.D.
Maybe it's not here.
So first find the location of PHP-FPM:
Command: PHP-FPM Find/-name ' PHP-FPM '
When you find it, stop it first.
Command: PHP-FPM stop
Delete it. Add PHP-FPM to the correct version that you want.
Command: Ls-s/a/apps/php-5.4.41/sbin/init.d.php-fpm php-fpm
And then run
PHP-FPM start II, PHP used in the CLI, which is the command line
Generally in Usr/bin usr/local/bin. Look for it yourself anyway.
Also change the soft connection can be.
After this process, I found a good problem. So think of a good way. Anyway, all the places in the system that use PHP are the way to build a soft connection from these PHP programs. So I set up a unified portal for these different versions.
So the other soft connections point to this PHP. This PHP soft connection acts as an interface.
Then I need to switch versions of the time. Just point to the correct version of this PHP. Because you never know how many places to change.
(I was also known by the pit)
* Note to reboot PHP-FPM