记一次本地环境配置出错 No input file specified

同样的代码在本地报错No input file specified,但在服务器上不存在问题。

解决思路:查看nginx错误日志,打开error.log,果然发现有一条报错信息,具体的报错信息为:

 FastCGI sent in stderr: "PHP Warning:  Unknown: open_basedir restriction in effect. File(D:\space\kloc\index.php) is not within the allowed path(s): (/var/www/kloc/:/tmp/:/proc/) in Unknown on line 0
PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0" while reading response header from upstream, client: 127.0.0.1, server: test4.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.test4.com"
百度有几种相关解决方案:

1.配置php.ini中的open_basedir目录,但是查看自己的php.ini配置文件,是 ";open_basedir =" (注释状态,我的理解应该是不限制任何路径访问),所以未尝试该方法

2.根目录中有一个.user.ini的文件,删除即可

猜你喜欢

转载自blog.csdn.net/qq_35043640/article/details/83184147