HowtoSolve“NoInputFileSpecified”withPHPandNginx

2022-5-16 18:48| 发布者: Hocassian| 查看: 82| 评论: 0|原作者: 樱花庄的白猫

摘要:
C:\Users\Administrator\Downloads\2019-10-14-0-25-44-134316851320199-樱花庄的白猫 ねこ・しろ・ましろ-采集的数据-后羿采集器.html

标题

How to Solve “No Input File Specified” with PHP and Nginx

标题链接

https://2heng.xin/2017/09/07/solve-no-input-file-specified-php-nginx/

post-date

发布于 2017-09-07

post-meta

3,856 热度

评价数

NOTHING

分类

野生技术协会

正文

When I tried to install YOURLS, a short URL generator, on my Nginx based PHP server, I met a great many of problem. In those problems, the most bothering one was Nginx shows No Input File Specified.

When I first met this Error Code, definitely, I tried to find the solution on Google, there are pretty many results. Almost all of them says that it's the problem on fastcgi_param SCRIPT_NAME of Nginx default configuration file. Some of them say pretty well, like this. I'm not mean these articles are wrong, but the modifying of fastcgi_param SCRIPT_NAME do not solve my problem at all. So I guess maybe the problem is not Nginx? Yep, when I first tried to edit the php.ini file, I succeed.

OK, first let me describe my problem before.

Just after unzipped the YOURLS installation files, configured the DNS correctly, and simply copied the Nginx configuration for WordPress, I opened the YOURLS management page (index.php actually) in browser, I got No Input File Specified (there is a pretty strange problem I don't understand till now, that these "No Input File Specified" browse leave no log in Nginx error log).

The final solution was from this blog. It's so easy just to modify php.ini like this:

# Adding this line (very important):
fastcgi.impersonate = 1
# Uncomment these lines:
cgi.fix_pathinfo=1
cgi.force_redirect = 0 #Actually there is no this line in my `php.ini`, maybe due to the different version.

Then reload php-fpm, problem solved.

That's all.

标题:Nginx+PHP如何解决“NO INPUT FILE SPECIFIED”问题

既然是看到了中文的教程,索性用英文写一份,否则岂不是简单的转载了吗。

Q.E.D.

作者

Mashiro


路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部