nginx php-fpm 访问.php文件出现Access denied.

实习导演 发布于 2014/01/05 23:35
阅读 17K+
收藏 0

nginx的access.log就像这样:

2014/01/05 22:26:33 [error] 12519#0: *1517
 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/www/index.php) is not within the allowed path(s): (.:/tmp/) in Unknown on line 0
 PHP message: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
 Unable to open primary script: /usr/www/index.php (Permission denied)" while reading response header from upstream,
 client: 192.186.56.55, server: test.localhost.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: " test.localhost.com" 192.186.56.56 - - [05/Jan/2014:22:26:33 +0800] "GET / HTTP/1.1" 403 25 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36"
访问.html正常的..访问.php的就会出现Access denied.

谢谢各位...

以下是问题补充:

@实习导演:FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/www/index.php) is not within the allowed path(s): (.:/tmp/) in Unknown on line 0 (2014/01/05 23:36)
加载中
1
自由PHP
自由PHP

其实这个报错很容易理解,说open_basedir受到了限制

我找到了这一篇文章,希望对你有用

http://www.oschina.net/question/878142_106780

实习导演
实习导演
非常感谢
返回顶部
顶部