Nignx Specifies which PHP to use depends on which PHP php-fpm is
Reason
Because Nginx is the default listener is the 127.0.0.1:9000 port, the default 9000 port has been occupied by the previous PHP
1. set different port numbers for different php-fpm, with address port number as parameter at Fastcgi_pass
2.fastcgi_pass directly with the socket connection, just change the path
Solutions 1
Because Nginx is the default listener is 127.0.0.1:9000 port, the default 9000 port has been occupied by the previous PHP , please follow the following steps to configure:
1.cd/usr/local/php7/etc/php-fpm.d/www.conf, find listen 127.0.0.1:9000, and then change 9000 to custom, I myself modified to 9001, And then save the exit
2.cd/usr/local/nginx/conf/nginx.conf, find Fastcgi_pass this line, modified as: Fastcgi_pass 127.0.0.1:9001;
3. turn off the low version of PHP-FPM/ETC/INIT.D/PHP-FPM stop
4. turn on PHP7 php-fpm/etc/init.d/php7-fpm start
5. Restart nginx service nginx Restart
I'm done here and I hope to help you! With the php7 phpinfo interface, let's get a glimpse
Solutions 2
Close the previous PHP-FPM
and open the PHP-FPM now.
Possible Error resolution solution (
CP Php-fpm.conf.default php-fpm.conf
CP Www.conf.default www.conf
)
What version of PHP is used by Nginx depends on PHP-FPM which PHP version