VPS侦探论坛

 找回密码
 注册
查看: 4967|回复: 3

lnmp1.3一键安装包nginx新建虚拟主机No input file specified.

[复制链接]
发表于 2016-3-3 11:05:05 | 显示全部楼层 |阅读模式

之前用的是1.2该问题存在,之后换1.3,该问题还存在就是用lnmp新建虚拟主机后访问PHP文件通通报No input file specified.错误


不知道为什么


这里请教军哥,谢谢了!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 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 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-3-3 13:37:50 | 显示全部楼层

你修改了网站目录,但是网站根目录下的.user.ini 没改或没该正确,看前面提示信息你可能写的是相对路径而不是绝对路径
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-3-3 19:05:16 | 显示全部楼层

回复 3# 的帖子




谢谢军哥,.user.ini文件里果然是相对路径,谢谢
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 23:29 , Processed in 0.026309 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表