Reply to Re: [PHP] On register_shutdown_function: What might be the problem?

Your name:

Reply:


Posted by Andrι Medeiros on 07/23/05 01:36

Given it's a fatal error, it's as bad as a syntax error. It cancels
everything it's doing and leaves.

Remember that, even the shutdown function has to obey the time limit.

On 7/22/05, Liang ZHONG <little00wofl@hotmail.com> wrote:
> <?php
>
> set_time_limit(0);
> function f(){
> $count=10000000;
> for($i=0; $i<$count; $i++){ }
>
> exec("touch /tmp/ccc");
> }
>
>
> register_shutdown_function('f');
>
> header("Content-type: text/plain");
> header("Location: y.html");
> ?>
>
>
> When the time_limit is set to 0, the redirect page will be shown in 20
> second after the file ccc is created.
> When the time_limit is set to 5, the redirect page will be shown in 5 second
> and the ccc file is not created. The error from curl command line tool is
> as:
> ---------------------------------------
> <br />
> <b>Fatal error</b>: Maximum execution time of 5 seconds exceeded
> in<b>/...../y.php</b> on line <b>6</b><br />
> ----------------------------------------
>
> What might be the problem that my register shudown function can not
> continuously run after the main program end?
> What is the correct way to keep the function running after I redirect a
> existing page to http client and then immediately close the connection?
>
> Thank you very much for your help.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация