Skip to content

Codeigniter PHP script timeout

Yesterday I faced a weird problem.
I wanted to execute a (long) PHP shell script, but after 30 seconds it went in timeout.

The solution I found after some Google search was to comment the line with @set_time_limit(300);
in file system/core/CodeIgniter.php

/*
* ------------------------------------------------------
*  Set a liberal script execution time limit
* ------------------------------------------------------
*/
    if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
    {
        //@set_time_limit(300);  # <-- Comment this line to remove 300 secs limit.
    }