如何增加在.htaccess Apache的超时指令? [英] How to increase apache timeout directive in .htaccess?

查看:323
本文介绍了如何增加在.htaccess Apache的超时指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何增加的.htaccess Apache的超时指令?我有很长的$ _ POST ['脚本'],需要一个用户大概10分钟填写所有数据。问题是如果时间过长比页面超时或东西,它关系到一个网页未找到错误页面。会增加阿帕奇超时指令在.htaccess是我要找的答案。我想这是设置为300秒,但我不知道如何来增加或者如果这甚至是我应该做的......无论哪种方式,我怎么增加默认时间?谢谢你。

How do I increase the apache timeout directive in .htaccess? I have a LONG $_POST['script'] that takes a user probably 10 minutes to fill in all the data. The problem is if it takes too long than the page times out or something and it goes to a webpage is not found error page. Would increasing the apache timeout directive in .htaccess be the answer I'm looking for. I guess it's set to 300 seconds by default, but I don't know how to increase that or if that's even what I should do... Either way, how do I increase the default time? Thank you.

推荐答案

如果你有很长的处理服务器端code,我不认为它落入404如你所说(它去网页未找到错误页面

if you have long processing server side code, I don't think it does fall into 404 as you said ("it goes to a webpage is not found error page")

浏览器应该报告请求超时错误。

Browser should report request timeout error.

您可以做两件事:

根据CGI /服务器端引擎增加超时有

Based on CGI/Server side engine increase timeout there

PHP:<一href="http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time">http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time - 默认为30秒

PHP : http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time - default is 30 seconds

在php.ini中:

max_execution_time 60


增加阿帕奇超时


Increase apache timeout

<一个href="http://httpd.apache.org/docs/2.0/mod/core.html#timeout">http://httpd.apache.org/docs/2.0/mod/core.html#timeout - 默认为300

http://httpd.apache.org/docs/2.0/mod/core.html#timeout - default is 300

在你的httpd.conf(在服务器配置或虚拟主机配置)

In your httpd.conf (in server config or vhost config)

TimeOut 600


请注意,首先设置允许你的PHP脚本运行的时间更长,因此不会与网络超时interferre。


Note that first setting allows your PHP script to run longer, it will not interferre with network timeout.

第二设定修改的时候,服务器会等待某些事件失败的请求之前最高金额

Second setting modify maximum amount of time the server will wait for certain events before failing a request

对不起,我不知道,如果你使用的是PHP作为服务器端处理,但如果你提供更多信息我会更加准确。

Sorry, I'm not sure if you are using PHP as server side processing, but if you provide more info I will be more accurate.

这篇关于如何增加在.htaccess Apache的超时指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆