Ekky
Ekky

Reputation: 790

CodeIgniter php script is not running more than 2 minutes??

I have a PHP script in my Code Igniter application, its run on server and fetch some data but its not running more than 2 minutes approx.. and when I run this without using code igniter its works properly..what may be the reason behind this?

Upvotes: 0

Views: 5743

Answers (3)

Web7
Web7

Reputation: 126

There must be, Set_time_limit - Sets the maximum execution time of a script.

bool set_time_limit ( int $seconds )

When set_time_limit() called. It returns the counter to zero. In other words, if the default limit is 30 seconds, and after 25 seconds of script execution the set_time_limit(20) call is made, then the script will run for a total of 45 seconds before finishing .

Please visit http://php.net/manual/fr/function.set-time-limit.php for more information.

Upvotes: 0

Ekky
Ekky

Reputation: 790

thanks @air4x its works . by setting set_time_limit(300) in the system/core/CodeIgniter.php

if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
{
    @set_time_limit(300);
}

after setting this code script running well..

Upvotes: 1

Justin
Justin

Reputation: 27331

Try adding this before you run your code: set_time_limit(0);

More info: http://php.net/manual/en/function.set-time-limit.php

If that doesn't work, you'll need to share what code you are running and what happens when it stops running.

Upvotes: 0

Related Questions