nginx解析php失败,为什么nginx不能解析php?
只運行過這些代碼
yum?install?-y?vim?wget?zip?unzip??git?httpd?php?php-mysql?php-odbc?php-ldap?php-gd?php-mbstring?php-xml?php-xml-rpc?php-bcmath?libjpeg*?mariadb?;
rpm?-Uvh?http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm;
yum?install?-y?nginx;
service?nginx?start
systemctl?enable?nginx.service
firewall-cmd?--zone=public?--add-port=80/tcp?--permanent
firewall-cmd?--reload
我是centos7
這個是nginx的配置
server?{
listen???80;
root?/usr/share/nginx/html/mysite;
index?index.html?index.htm?index.php;
server_name?localhost;
location?/?{
#?URL重寫支持
try_files?$uri?$uri/?/index.php?s=$uri&$args;
}
#?開啟PHP支持
location?~?\.php?{
fastcgi_split_path_info?^(.+\.php)(.*)$;
fastcgi_pass?unix:/var/run/php5-fpm.sock;
fastcgi_index?index.php;
fastcgi_param?PATH_INFO?$fastcgi_path_info;
#?環境變量
fastcgi_param?CT_DEV_MODE?'true';
#?加載Nginx默認"服務器環境變量"配置
include?fastcgi_params;
}
}
頁面提示403 Forbidden還有nginx的版本號
總結
以上是生活随笔為你收集整理的nginx解析php失败,为什么nginx不能解析php?的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 三星830固态硬盘寿命(三星固态硬盘85
- 下一篇: php中时间轴,PHP时间轴函数
