php.ini中max_execution_time=30并用如下程序测试效果,结果在网页上,无限运行了下去。<?php
header("Content-Type: text/plain"); while(true)
{
echo ini_get('max_execution_time')."\n"; //打印出来的结果就是30
flush();
ob_flush();
sleep(30);
}
?>
header("Content-Type: text/plain"); while(true)
{
echo ini_get('max_execution_time')."\n"; //打印出来的结果就是30
flush();
ob_flush();
sleep(30);
}
?>
解决方案 »
- thinkphp 获取配置文件
- 关于根目录index.php的问题
- 菜鸟问些很基础的问题,php是不是我代码保存为php文件然后一个单个的php文件传到空间可以吗?多谢!!
- 菜鸟求教 用php做 validation**************在线等
- 如何使用VC++扩展PHP5?
- PHP 如何访问另外一台电脑上的数据库?
- 在apache的服务器里怎么样给各个不同的用户分配php权限?
- 谁用过phpbb?phpbb2.01怎么样升级到2.04
- 各位大神,加入我点击了‘’临床‘’,怎么用ajax获得临床的ID
- PHP未定义数组索引
- 访问MySQL的一个神奇的问题,'aaaaaa'等于'妹妹美'?
- 如何将下拉框的值改为昨天的日期
This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.
while(true){
flush();
ob_flush();
sleep(2);
}报出的信息:第二条Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in D:\documentRoot\test.php on line 8Fatal error: Maximum execution time of 2 seconds exceeded in D:\documentRoot\test.php on line 10
我也认为是这个原因,可是无论php.ini或httpd.conf都没有设置安全模式啊。
php.ini:
;
; Safe Mode
;
safe_mode = Off