Problem with connection_status() and Apache 1.3.12

From: Date: Mon, 06 Nov 2000 17:28:49 +0000
Subject: Problem with connection_status() and Apache 1.3.12
Groups: php.general 
Request: Send a blank email to php-general+get-23924@lists.php.net to get a copy of this message
Hi, I'm having a problem with using PHP's connection handling functions. In a nutshell, they don't work. My setup is Apache 1.3.12 and PHP 3.0.16 compiled as a module. I grabbed the following code from php.faqts.com that Rasmus wrote as a test: <?
    set_time_limit(5);
    ignore_user_abort(0);
    register_shutdown_function("done");
    function done() {
        global $i, $fp;
        fputs($fp,"i reached $i\n");
        if(connection_aborted())
            fputs($fp,"** the connection was aborted **\n");
        fclose($fp);
        echo "all done\n";
    }
    $fp = fopen("/tmp/done","w");
    for($i=0; $i<7; $i++) {
        fputs($fp,"i is $i\n");
        for($j=0;$j<1000;$j++) $a=sqrt($j);
        sleep(1);
        echo "$i...................................<br>";
        flush();
    }
    exit;
?> Yet when I hit the Stop button in Netscape to abort the script before it's done, /tmp/done still contains all seven lines as if the script had run to completion. I've searched high and low in the manual and php-general for anything that might shed light on this, but haven't found any solutions to my problem. Can somone please help? Is there something in my configuration that isn't right? Was I supposed to compile PHP with a certain directive turned on/off? Thanks in advance, --- Derek Fong web://developer Zero-Knowledge Systems [http://www.zeroknowledge.com/] PGP Fingerprint >> 2D4F 89F0 EAC1 FBFB 97B5 0B94 FA05 C29E D23B 0A4E

« previous php.general (#23924) next »