超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<Apacheapache_get_modules>
Last updated: Fri, 22 Jun 2007

apache_child_terminate

(PHP 4 >= 4.0.5, PHP 5)

apache_child_terminate -- 在本次请求结束后终止 apache 进程

说明

bool apache_child_terminate ( void )

apache_child_terminate() 将把运行当前 PHP 请求的 Apache 进程注册为终止状态,一旦结束 PHP 代码的运行此进程将终止。可以用在占用大量内存的脚本后面来终止该进程,因为通常内存只在内部释放而不会还给操作系统。

注: 能否使用本特性受到 php.ini 中的指令 child_terminate 的控制,其值默认为 off

本特性不能用于 apache 的多线程版本下,例如 win32 版本。

参见 exit()




add a note add a note User Contributed Notes
apache_child_terminate
anonymous at person dot com
28-Nov-2003 07:14
<?php
function term() {
if(function_exists('apache_child_terminate')) {
apache_child_terminate();
}
die('Terminated');
}
?>

Also, when apache_child_terminate is called, it terminates the script, so die()/exit() is not necessary if the script is 100% sure to be on an apache 1.x server, else a die()/exit() is as good as it gets.

I found its a semi-good idea to terminate the child if available after critical low-level errors.

<Apacheapache_get_modules>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22