Re: Question about set_time_out and shell_exec

From: Date: Wed, 24 May 2006 18:32:50 +0000
Subject: Re: Question about set_time_out and shell_exec
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-236847@lists.php.net to get a copy of this message
On 5/24/06, Suhas <psuhas@gmail.com> wrote:
Hi, I am trying to write a script which will avoid browser timeout problem and in that process I have created 2 files FILE1.php: set_time_out(1); echo shell_exec("/usr/local/bin/php -f FILE2.php &"); FILE2.php: @mail($to,$sub,$msg); sleep(60); @mail($to,$sub,$msg); I run File1.php thr' browser and I get 2 emails 1 min apart. But browser does not timeout and PHP also does not throw error about timeout even if I have specified time limit to 1sec. Is there any explanation to this behaviour?
Things that happen "outside the execution of the script" like program execution with system() or shell_exec() are not affected by set_time_limit. This is mentioned in the docs: php.net/set_time_limit. Rabin

« previous php.general (#236847) next »