lnmp1.3一键安装包nginx新建虚拟主机No input file specified.
之前用的是1.2该问题存在,之后换1.3,该问题还存在就是用lnmp新建虚拟主机后访问PHP文件通通报No input file specified.错误不知道为什么
这里请教军哥,谢谢了! 访问HTML页面是正常的
NGINX错误日志:
2016/03/03 11:06:12 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用户定义:
userwww wwwgroup;
查看文件:
# vim /usr/local/nginx/conf/nginx.conf
# ls -al /home/wwwroot/
总用量 0
drwxrwxrwx. 4 wwwwwwgroup31 3月 2 17:18 .
drwxr-xr-x. 9 root root 89 3月 2 16:39 ..
drwxrwxrwx. 3 wwwwwwgroup 101 3月 2 16:39 default
drwxrwxrwx. 2 wwwwwwgroup57 3月 2 17:40 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.logaccess;
error_log/home/wwwlogs/www.gysc.test.error.logerror;
}
[ 本帖最后由 vsgeping 于 2016-3-3 11:19 编辑 ] 你修改了网站目录,但是网站根目录下的.user.ini 没改或没该正确,看前面提示信息你可能写的是相对路径而不是绝对路径
回复 3# 的帖子
谢谢军哥,.user.ini文件里果然是相对路径,谢谢
页:
[1]