【发布时间】:2011-04-12 16:22:31
【问题描述】:
我想更改 PHP 脚本的最长执行时间。在我尝试过的脚本中
ini_set("max_execution_time", "1000");
和
set_time_limit(1000);
一起和分开。
我还在 .htaccess 中添加了这一行:
php_value max_execution_time 1000
php.ini 已关闭安全模式,并且 Apache 服务器具有标志 AllowOverride All。我必须怎么做才能让服务器允许更长的执行时间?
【问题讨论】:
-
你试过在 php.ini 文件中正确设置吗?
-
Apache 的 AllowOverride 与 PHP 设置无关。
-
br.php.net/manual/en/configuration.changes.php 尝试设置并在获取值后检查它...
-
我忘了提到我在
.htaccess中放了一个php_value max_execution_time 1000,这就是我提到AllowOverride 的原因。 -
你是直接向apache发送请求吗?即使 apache 没有,代理也可能超时。如果你在调用
set_time_limit(1000);之后运行var_dump(ini_get('max_execution_time'), ini_get('safe_mode'));,你会得到什么?
标签: php apache execution-time