rvaneperen Posted July 3, 2006 Share Posted July 3, 2006 I am fairly new to PHP, and I'm working on a page that is doing a large number of inserts into a mySQL database. It works fine for the most part, but sometimes I get the following [i]"[error] [client 127.0.0.1] PHP Fatal error: Maximum execution time of 60 seconds exceeded in...[/i]". I have my php.ini set to the following: max_execution_time = 120, but this doesn't work (assuming restarting apache is all it takes to get this setting to take effect). Is this the right setting to change, or is this controlled somewhere else? Quote Link to comment https://forums.phpfreaks.com/topic/13516-maximum-execution-time-error/ Share on other sites More sharing options...
wildteen88 Posted July 3, 2006 Share Posted July 3, 2006 Basically your PHP script has run longer than the max execution time set in the PHP.iniYou need to find the following line in the php.ini:[i]max_execution_time = 60[/i]And chnage 60 to the time in secounds for how long you want your scripts to timeout at. Save your php.ini and restart your server.Now to test this chnage has taken affect. Run the following script:[code=php:0]<?phpphpinfo();?>[/code]When you run that code you should get a page full of information about PHP and the server. Now scroll down a find the line that starts with this:[b]max_execution_time[/b]. Both coloumns to the right should state what you set in the php.ini, for exmaple 120If they dont scroll back up to the top and verify that PHP is using the correct php.ini by looking for line that starts of with this:[b]Configuration File (php.ini) Path[/b]. To the right of that it should state the full path to your php.ini file. Is the php.ini file in the location it is showing. If it is not in the location stated then PHP is currently not using the php.ini file. You can fix this by finding you php.ini file and moving it to the WINDOWS folder or if you have Apache2 installed you can add the following line to the httpd.conf file:[b]PHPIniDir C:\WINDOWS[/b]Change C:\WINDOWS to the correct path. For example if your php.ini file is in your PHP folder then use this: C:\php, presumming your PHP folder is in the root of the C drive.Once you have moved or added the PHPiniDir line to Apaches config file save any files you have changes and restart Apache. Run the phpinfo script again and check whether PHP is using the correct php.ini fileand that the max_execution_time setting has been updated. Quote Link to comment https://forums.phpfreaks.com/topic/13516-maximum-execution-time-error/#findComment-52462 Share on other sites More sharing options...
rvaneperen Posted July 3, 2006 Author Share Posted July 3, 2006 Thanks for the reply. As stated in my post, I did have max_execution_time set to 120 in php.ini. Running phpinfo confirmed it and the fact that it was looking at the correct instance of php.ini. However, as I have continued looking at this, I found some other related posts that seem to suggest that running Apache2.2 might be the culprit. For instance, I got errors when I tried to add the PHPIniDir entry to httpd. Is this just a matter of downgrading to Apache2.0 perhaps? Quote Link to comment https://forums.phpfreaks.com/topic/13516-maximum-execution-time-error/#findComment-52491 Share on other sites More sharing options...
wildteen88 Posted July 3, 2006 Share Posted July 3, 2006 If you are usiong Apache2.2 you should downgrade to Apache2.0.x. PHP doesnt offically support Apache2.2.xAlso about the PHPIniDir line. I forgot to add quotes around the Path. Quote Link to comment https://forums.phpfreaks.com/topic/13516-maximum-execution-time-error/#findComment-52494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.