Jump to content


server timeout

  • Please log in to reply
4 replies to this topic

#1 jwstockwell

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 July 2006 - 11:19 AM

Running a script trying to insert 40,000 + zipcodes into a table:

I don't think I see it in the apache error log but I'll ask anyway.

Is this from mysql or apache?

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Group\Apache2\htdocs\add_zipcodes.php on line 580

and what do I need to change to fix it?


#2 wildteen88

  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 July 2006 - 11:30 AM

This is from PHP. By defualt PHPs max execution time of a script is 30secs which more than enough for a script. However in your case it appears your SQL query is taking a lot of processing time, prehaps due to too many overheads or sommit. To solve this, find and edit your php.ini file. Find the following line within the php.ini:
max_execution_time = 30 ; Maximum execution time of each script, in seconds
Change 30 to 60.
Save the php.ini. Now you'll need to restart Apache in order for the updated php setting to take affect. If that fails to work go for 120. I wouldn't advise you to go over 120 secounds. As a script shouldn't need to take 2mins or more to execute.

#3 jwstockwell

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 27 July 2006 - 11:31 AM


#4 shocker-z

  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 27 July 2006 - 11:33 AM

if you prefer just this page to have long timeout then you could try

set_time_limit (120);

www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#5 kenrbnsn

  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 27 July 2006 - 11:43 AM

<?php set_time_limit(0); ?>
allows unlimited time, which can lead to problems if you have an infinate loop in your code... :)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users