- 积分
- 2
- 威望
-
- 金钱
-
- 注册时间
- 2016-3-3
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-3-3 11:09:41
|
显示全部楼层
访问HTML页面是正常的
NGINX错误日志:
2016/03/03 11:06:12 [error] 8341#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/home/wwwroot/gysc/phpinfo.php) is not within the allowed path(s): (gysc:/tmp/:/proc/) 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: /home/wwwroot/gysc/phpinfo.php (Operation not permitted)" while reading response header from upstream, client: 192.168.1.103, server: www.gysc.test, request: "GET /phpinfo.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "www.gysc.test"
nginx用户定义:
user www wwwgroup;
查看文件:
[root@localhost gysc]# vim /usr/local/nginx/conf/nginx.conf
[root@localhost gysc]# ls -al /home/wwwroot/
总用量 0
drwxrwxrwx. 4 www wwwgroup 31 3月 2 17:18 .
drwxr-xr-x. 9 root root 89 3月 2 16:39 ..
drwxrwxrwx. 3 www wwwgroup 101 3月 2 16:39 default
drwxrwxrwx. 2 www wwwgroup 57 3月 2 17:40 gysc
[root@localhost gysc]# ls -al /home/wwwroot/gysc/phpinfo.php
-rwxrwxrwx. 1 www wwwgroup 17 3月 2 17:34 /home/wwwroot/gysc/phpinfo.php
虚拟主机配置文件:
vim /usr/local/nginx/conf/vhost/www.gysc.test.conf
server
{
listen 80;
#listen [::]:80;
server_name www.gysc.test gysc.test;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/gysc;
include other.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /home/wwwlogs/www.gysc.test.access.log access;
error_log /home/wwwlogs/www.gysc.test.error.log error;
}
[ 本帖最后由 vsgeping 于 2016-3-3 11:19 编辑 ] |
|