PHP php-fpm Nginx
Installing the Yum source Remi
RPM-UVH http://mirrors.opencas.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm
RPM-IVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Installing the Software
One. PHP php-fpm
Packages that use the Remi Source
Yum--enablerepo=remi Install PHP php-fpm
Two. Installing Nginx
Install Nginx Source (CENTOS6 system to install http://nginx.org/packages/centos/5/x86_64/RPMS/nginx-1.8.0-1.el5.ngx.x86_64.rpm directly below)
RPM-IVH http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Yum Install Nginx
Three. Configuration
Vi/etc/nginx/nginx.conf
Modify
Location ~ \.php$ {
root/usr/share/nginx/html; #修改为网站路径
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name; #document_root指的是上面的root, use PHP-FPM parsing for php files under this path
Include Fastcgi_params;
}
Three. Start Php-fpm,nginx
/etc/init.d/nginx start
/ETC/INIT.D/PHP-FPM start
If you modify the configuration file, use/etc/init.d/nginx reload to load
Four. Testing
Under the Nginx path
Cd/usr/share/nginx/html
VI index.php
<?php
Phpinfo ();
?>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/A4/wKiom1WBPSHDWu2eAAMZ_8d5xBY185.jpg "title=" Php.png "alt=" Wkiom1wbpshdwu2eaamz_8d5xby185.jpg "/>
Yum installs Nginx and PHP-FPM