1.3 访问PHP时出现No input file specified. 修改.user.ini后500
我网站 访问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" (原设置时)
"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 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" open_basedir的设置必须是绝对路径,500错误的话需要开启php错误日志看看什么错误信息
回复 2# 的帖子
WARNING: child 390 said into stderr: "NOTICE: PHP message: PHP Warning:require(): open_basedir restriction in effect. File(/home/wwwroot/ss.panel/bootstra$WARNING: child 390 said into stderr: "NOTICE: PHP message: PHP Warning:require(/home/wwwroot/ss.panel/bootstrap.php): failed to open stream: Operation not$
WARNING: child 390 said into stderr: "NOTICE: PHP message: PHP Fatal error:require(): Failed opening required '/home/wwwroot/ss.panel/public/../bootstrap.$ 慢日志信息不完整,.user.ini 设置到 /home/wwwroot/ss.panel 应该就可以了,就不会有open_basedir restriction in effect的错误了
failed to open stream: Operation not 这个信息不完整,可能是提示的文件不存在吧
回复 4# 的帖子
抱歉军哥,复制时沒留意到后面还有,WARNING: 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"
WARNING: 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"
WARNING: 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" 谢了,军哥,以自行解決,开了日志就查到原因了,忘了裝composer.phar 麻烦军哥了.
页:
[1]