Wednesday, September 12, 2012

Need More Execution Time without Changing PHP.INI

Sometimes it is required to execute multiple commands in a single script that requires more time than usual. We can edit and increase execution time limit from "php.ini" to avoid termination of execution because of outrun of allowed execution time limit. Where increase is only needed for some specific functions or scripts it is unnecessary to change php.ini file. We can easily add more execution time by adding following line before the bigger time consuming functions/codes:

set_time_limit(120);

Code displayed above is defining 120 seconds as a limit of execution time.

No comments:

Post a Comment