Page 1 of 1

[SOLVED] - Maximum execution time of 30 seconds exceeded

Posted: Sat Mar 12, 2005 8:02 am
by anjanesh
There is the html file that Im loading :

Code: Select all

$lines=file("somwhere.com/somepage.html");
But it very often (98%) shows the error :
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xxx\xxx.php on line nn
This is probably because of my slow net connection (64kbps) - I've to try it on my host.
But is there a better alternative ? Do most web hosts set their max execution time to 30s or it'll be real fast to load this ?
Thanks

Posted: Sat Mar 12, 2005 8:46 am
by Chris Corbyn
php.net wrote:set_time_limit -- Limits the maximum execution time
Description
void set_time_limit ( int seconds)


Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini. If seconds is set to zero, no time limit is imposed.

Code: Select all

set_time_limit(0);

Posted: Sat Mar 12, 2005 8:51 am
by Buddha443556
Is this something you could setup as a cron job to fetch? I suggest this because PHP isn't the only timeout. Servers have timeouts too usually at 300 seconds. You could find yourself with requests piling up before 5 minute server timeout kills them.

The default timeout for PHP is 30 seconds. I never seen a host change that default yet. Some hosts don't allow_url_fopen though.

Posted: Sat Mar 12, 2005 9:22 am
by anjanesh
Buddha443556 wrote:Is this something you could setup as a cron job to fetch? I suggest this because PHP isn't the only timeout.
No. This is some content taken from a site (html file) as they dont provide RSS Feeds. I had to extract a small portion of it but the page was big and I had to parse the entire thing.
Thanks for your help.