VPS侦探论坛

 找回密码
 注册
查看: 4989|回复: 5

1.3 访问PHP时出现No input file specified. 修改.user.ini后500

[复制链接]
发表于 2017-5-1 15:25:44 | 显示全部楼层 |阅读模式

我网站 访问PHP时出现No input file specified 当我修改.user.ini 后, 会报错500 有將ROOT 由 ss.panel 改成 /home/wwwroot/ss.panel/public/

.user.ini 原设置
open_basedir=ss.panel:/tmp/:/proc/  改成 open_basedir=ss.panel/public:/tmp/:/proc/  都是出现 No input file specified  
在改成绝对路徑后 open_basedir=/home/wwwroot/ss.panel:/tmp/:/proc/ 后成500了

tmas.site.conf

server
    {
        listen 80;
        #listen [::]:80;
        server_name tams.site ss.panel;
        index index.html index.htm index.php default.html default.htm default.php;
        root /home/wwwroot/ss.panel/public;

        include none.conf;
        #error_page   404   /404.html;
        include enable-php-pathinfo.conf;

        location / {
                        try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }
location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/ss.tkser.xyz.log;
    }


域名LOG
"GET / HTTP/1.1" 404 56 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36" (原设置时)
[01/May/2017:15:02:05 +0800] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36"  (改成绝对路徑时.)

nginx_error.log
2017/05/01 14:19:06 [crit] 6176#0: *1 connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream,client: xxx.xxx.xxx.xxx, server: tams.site, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "tams.site"
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-5-1 19:08:17 | 显示全部楼层


open_basedir的设置必须是绝对路径,500错误的话需要开启php错误日志看看什么错误信息
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-5-5 13:49:37 | 显示全部楼层

回复 2# 的帖子


[05-May-2017 13:48:32] WARNING: [pool www] child 390 said into stderr: "NOTICE: PHP message: PHP Warning:  require(): open_basedir restriction in effect. File(/home/wwwroot/ss.panel/bootstra$
[05-May-2017 13:48:32] WARNING: [pool www] child 390 said into stderr: "NOTICE: PHP message: PHP Warning:  require(/home/wwwroot/ss.panel/bootstrap.php): failed to open stream: Operation not$
[05-May-2017 13:48:32] WARNING: [pool www] child 390 said into stderr: "NOTICE: PHP message: PHP Fatal error:  require(): Failed opening required '/home/wwwroot/ss.panel/public/../bootstrap.$
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-5-5 21:23:19 | 显示全部楼层



慢日志信息不完整,.user.ini 设置到 /home/wwwroot/ss.panel 应该就可以了,就不会有open_basedir restriction in effect的错误了

failed to open stream: Operation not 这个信息不完整,可能是提示的文件不存在吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-5-5 22:40:21 | 显示全部楼层

回复 4# 的帖子


抱歉军哥,复制时沒留意到后面还有,
[05-May-2017 22:35:27] WARNING: [pool www] child 3718 said into stderr: "NOTICE: PHP message: PHP Warning:  require(): open_basedir restriction in effect. File(/home/wwwroot/ss.panel/bootstrap.php) is not within the allowed path(s): (/home/wwwroot/ss.panel/public:/tmp/:/proc/) in /home/wwwroot/ss.panel/public/index.php on line 7"

[05-May-2017 22:35:27] WARNING: [pool www] child 3718 said into stderr: "NOTICE: PHP message: PHP Warning:  require(/home/wwwroot/ss.panel/bootstrap.php): failed to open stream: Operation not permitted in /home/wwwroot/ss.panel/public/index.php on line 7"

[05-May-2017 22:35:27] WARNING: [pool www] child 3718 said into stderr: "NOTICE: PHP message: PHP Fatal error:  require(): Failed opening required '/home/wwwroot/ss.panel/public/../bootstrapap.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/ss.panel/public/index.php on line 7"

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2017-5-5 22:58:25 | 显示全部楼层

谢了,军哥,以自行解決,开了日志就查到原因了,忘了裝composer.phar 麻烦军哥了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 14:19 , Processed in 0.026848 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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