johnsmith153 Posted January 9, 2009 Share Posted January 9, 2009 What is the maximum number of seconds I can apply to 'max_execution_time' ? I think if I put something silly like 999999 it may just reset to a low default. I need a high limit for a task that requires access to a Web Service API that takes up a lot of server time. Quote Link to comment Share on other sites More sharing options...
RussellReal Posted January 9, 2009 Share Posted January 9, 2009 set_time_limit and sorry, I'm not exactly sure what the max is.. but I know 0 would be like.. forever Quote Link to comment Share on other sites More sharing options...
johnsmith153 Posted January 9, 2009 Author Share Posted January 9, 2009 One of us is an idiot. If it is me, I am sorry. Can somebody else please help? Quote Link to comment Share on other sites More sharing options...
RussellReal Posted January 9, 2009 Share Posted January 9, 2009 u shud be sorry but sorry my solution didn't help u Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted January 9, 2009 Share Posted January 9, 2009 max_execution_time is an integer, so the maximum value that you can set is 2147483647 seconds (over 68 years) on a 32-bit system (i.e 2^31, with the msb reserved for the sign). The alternative is to set the value to 0, which means that the script will never time out. Of course, if you're running you script through the web server, as a CGI script, then the web server is also likely to have its own timeout. The set_time_limit function allows you to override this value, and dynamically extend the time-out period one or more times during script execution; though it's still constrained by the web server timeout. Quote Link to comment Share on other sites More sharing options...
DarkSuperHero Posted January 9, 2009 Share Posted January 9, 2009 so can the web server overide this new set time out in the script? Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted January 9, 2009 Share Posted January 9, 2009 so can the web server overide this new set time out in the script? The web server does override the PHP limit. The web server will send an appropriate response to the client browser when it times out, if PHP has not finished executing. I can't recall what the Apache config parameter is off the top of my head, but it's likely to be in the httpd.conf file. However, Apache default is something like 300 seconds (5 minutes). Most people would abort a page if they hadn't had a response in this time. So you also need to determine what should happen if the user aborts their transaction, or closes their browser window because they're fed up waiting to see a response. Quote Link to comment Share on other sites More sharing options...
pagegen Posted March 25, 2010 Share Posted March 25, 2010 ini_set('max_execution_time', 300); Quote Link to comment Share on other sites More sharing options...
oni-kun Posted March 25, 2010 Share Posted March 25, 2010 ini_set('max_execution_time', -1); Duh. Quote Link to comment 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.