1. Because I do not know why, in the Internet to find a lot of information, nginx to and PHP-FPM, so before using Nginx configuration to install PHP-FPM
2.yum Install Php70w-fpm,service php-fpm start
Using Yum install PHP-FPM will error
Error:php70w-common conflicts with php-common-5.4.16-42.el7.x86_64
You could try using--skip-broken to work around the problem
You could try Running:rpm-va--nofiles--nodigest
3.RPM-UVH http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
4.yum Install Nginx
Service Nginx Start
5.
# Find/-name nginx.conf
/etc/nginx/nginx.conf
See in the last line of nginx.conf
include/etc/nginx/conf.d/*.conf;
So find/etc/nginx/conf.d/default.conf;
Add a sibling below the location
Location ~ \.php$ {
root/var/www/html; #指定php的根目录
Fastcgi_pass 127.0.0.1:9000; The default port for the #php-FPM is 9000
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}
6.nginx-t If there are no errors, error to correct
7./usr/sbin/nginx-s Reload restart Nginx service
and build index.php in/var/www/html.
<?php
Phpinfo ();
Can see
CENTOS7 installation Lnmp (PHP7) nginx php-fpm yum Installation and configuration file modification