Jump to content

Archived

This topic is now archived and is closed to further replies.

jwstockwell

server timeout

Recommended Posts

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?

TIA
Jim

Share this post


Link to post
Share on other sites
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:
[code]max_execution_time = 30 ; Maximum execution time of each script, in seconds[/code]
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.

Share this post


Link to post
Share on other sites
if you prefer just this page to have long timeout then you could try

set_time_limit (120);


Regards
Liam

Share this post


Link to post
Share on other sites
Using
[code]<?php set_time_limit(0); ?>[/code]
allows unlimited time, which can lead to problems if you have an infinate loop in your code... :)

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.