php 如何解决:FastCGI 进程超出配置的请求超时错误:在 IIS 7.5 上
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23148813/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to address : The FastCGI process exceeded configured request timeout error: on IIS 7.5
提问by BioDeveloper
My PHP script executes some program on my server IIS 7.5
Takes time about 10 mins to execute but above error in browser.
How to resolve this.
我的 PHP 脚本在我的服务器 IIS 7.5 上执行一些程序
需要大约 10 分钟的时间来执行但在浏览器中出现以上错误。
如何解决这个问题。
Error:
错误:
HTTP Error 500.0 - Internal Server Error
C:\php\php-cgi.exe - The FastCGI process exceeded configured request timeout
Module FastCgiModule
Notification ExecuteRequestHandler
Handler FastCGI
Error Code 0x80070102
php.ini settings:
php.ini 设置:
fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo=1
cgi.force_redirect = 0
max_execution_time = 0
upload_max_filesize = 20M
memory_limit = 128M
post_max_size = 30M
C:\Windows\System32\inetsrv\config\ applicationHost.configfile settings for fast-cgi
C:\Windows\System32\inetsrv\config\ applicationHost.config文件设置 fast-cgi
<fastCgi>
<application
fullPath="C:\php\php-cgi.exe" activityTimeout = "3600" requestTimeout = "300" />
</fastCgi>
回答by zeta
There is one more setting I found from this sourcethat helped me with the same problem I was having. Copied and pasted:
我从这个来源找到了另一个设置,它帮助我解决了我遇到的同样问题。复制粘贴:
Open Server Manager
打开服务器管理器
At Server Level (not default Web site)
在服务器级别(不是默认网站)
- Double click FastCGI Settings
- open PHP.EXE listed there
- Monitor changes to file php.ini
- activity timeout default is 60s - change to 600s or whatever
- 双击 FastCGI 设置
- 打开那里列出的 PHP.EXE
- 监视对文件 php.ini 的更改
- 活动超时默认为 60 秒 - 更改为 600 秒或其他
回答by datasage
This is sort of a quick explanation of what is going on. When you are using a CGI/FCGI configuration for PHP. The webserver (in this case IIS), routes requests that require php processing to the PHP process (which runs separately from the web server).
这是对正在发生的事情的快速解释。当您为 PHP 使用 CGI/FCGI 配置时。Web 服务器(在本例中为 IIS)将需要 php 处理的请求路由到 PHP 进程(与 Web 服务器分开运行)。
Generally, to prevent connections from getting stuck open and waiting (if php process happens to crash) the web server will only wait a set amount of time for the PHP process to return a result (usually 30-60 seconds).
通常,为了防止连接卡在打开和等待中(如果 php 进程发生崩溃),Web 服务器只会等待一定的时间让 PHP 进程返回结果(通常为 30-60 秒)。
In your configuration you have this:
在您的配置中,您有:
requestTimeout = "300"
300 seconds = 5 minutes. IIS will cancel the request since your request takes 10 minutes to complete. Simple fix, increase the timeout to something 600 or greater.
300 秒 = 5 分钟。IIS 将取消请求,因为您的请求需要 10 分钟才能完成。简单的修复,将超时增加到 600 或更大。
Now, running a script for 10 minutes with an http request is not a good design pattern. Generally, http works best with short lived requests. The reason is that timeouts can exist in any part of the process (server, proxy, or client) and the script could be accidentally interrupted.
现在,使用 http 请求运行脚本 10 分钟并不是一个好的设计模式。通常,http 最适合短期请求。原因是进程的任何部分(服务器、代理或客户端)都可能存在超时,并且脚本可能会被意外中断。
So, when you have a web application that has a long running job like this, the best way to run it is via console or job queue.
因此,当您的 Web 应用程序有这样一个长时间运行的作业时,运行它的最佳方法是通过控制台或作业队列。
回答by sherin.k
This can be solve by adjusting fast-cgi configuration. Goto "C:\Windows\System32\inetsrv\"and edit "fcgiext.ini"file
这可以通过调整 fast-cgi 配置来解决。转到“C:\Windows\System32\inetsrv\”并编辑“fcgiext.ini”文件
[PHP]
ExePath=C:\xampp\php\php-cgi.exe
MonitorChangesTo=C:\xampp\php\php.ini
ActivityTimeout=3600
IdleTimeout=3600
RequestTimeout=3600
Make sure to place ActivityTimeout,IdleTimeout & RequestTimeout inside [PHP] section as shown above.
确保将 ActivityTimeout、IdleTimeout 和 RequestTimeout 放在 [PHP] 部分中,如上所示。