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

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

问题描述

如何增加 .htaccess 中的 apache 超时指令?我有一个 LONG $_POST['script'] 用户可能需要 10 分钟才能填写所有数据.问题是,如果它花费的时间比页面超时或其他原因花费的时间过长,并且它转到了一个未找到错误页面的网页.在 .htaccess 中增加 apache timeout 指令会是我正在寻找的答案.我想它默认设置为 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.

推荐答案

如果你有很长的处理服务器端代码,我认为它不会像你说的那样落入 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/Server端引擎增加超时有

Based on CGI/Server side engine increase timeout there

PHP: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 中:

In php.ini:

max_execution_time 60

<小时>

增加 apache 超时 - 默认为 300(在 2.4 版 是 60.


Increase apache timeout - default is 300 (in version 2.4 it is 60).

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

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

TimeOut 600

<小时>

请注意,第一个设置允许您的 PHP 脚本运行更长时间,它不会干扰网络超时.


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天全站免登陆