yum install php php-devel
安装的是5.4 那么安装完毕了,怎么设置nginx和php 解析
1 添加nginx 默认主页index.php
vim .../etc/nginx/nginx.conf
index index.html index.htm index.php
2配置nginx支持php
vim .../etc/nginx/nginx.conf
location ~ .php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; }
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; 注意红色部分的文件路径,在配置域名部署的时候 要和域名对应的目录保持一致
3 安装php-fpm
yum install php-fpm
connect() failed (111: Connection refused) while connecting to upstream
就是因为没有按照php-fpm