码迷,mamicode.com
首页 > Web开发 > 详细

nginx + php 403 原因分析

时间:2016-07-07 22:32:55      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:

环境:nginx + php

 

问题:

配置的网站,访问出现报错:Access Denied (403) 

 

解决方法:

1、In your PHP-fpm www.conf set security.limit_extensions to .php or .php5 or whatever suits your environment. For some users, completely removing all values or setting it to FALSE was the only way to get it working.

2、In your nginx config file set fastcgi_pass to your socket address (e.g. unix:/var/run/php-fpm/php-fpm.sock;) instead of your server address and port.

3、Check your SCRIPT_FILENAME fastcgi param and set it according to the location of your files.

4、In your nginx config file include fastcgi_split_path_info ^(.+\.php)(/.+)$; in the location block where all the other fastcgi params are defined.

5、In your php.ini set cgi.fix_pathinfo to 1

6、也有可能是文件权限的问题,没有读权限。

 

原文链接:http://stackoverflow.com/questions/23390531/access-denied-403-for-php-files-with-nginx-php-fpm

 

nginx + php 403 原因分析

标签:

原文地址:http://www.cnblogs.com/hjqjk/p/5651275.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!