Apr 20, 2008

Fatal error: Maximum Execution Time of xx Second Exceeded in filepath.php

Thanks for visiting.


satyakaran said...

I have found this comment on php.net very useful:

After the error
Fatal error: Maximum execution time of [...] seconds exceeded [...]
has appeared, shut-down functions are still called (afterwards). So, by using register_shutdown_function, you can save data in a session and offer the user a link to start the script again. Then the script can go on with the Session-data.

Example: if you are analyzing a text-file, you can save your analyzed data in a session together with the position of the filepointer (ftell) and start from that possition the next time the user runs the script (fseek).

To determine whether the script was finished or aborted, you simply set a bool false at the beginning and true at the end, and in the shutdown-function you check if it's still false.

Privacy Policies