Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3442704
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:42:06+00:00 2026-05-18T08:42:06+00:00

Is there a good reason not to set the PHP configuration variable max_execution_time to

  • 0

Is there a good reason not to set the PHP configuration variable max_execution_time to 0?

A coworker recently checked in a change to a file that added:

ini_set('max_execution_time', 0);

The default value had been too low for a page that did some complex processing before returning the output to the user.

The manual states that the main purpose of the setting is to:

prevent poorly written scripts from tying up the server.

But also goes on to state:

Your web server can have other timeout configurations that may also interrupt PHP execution. Apache has a Timeout directive and IIS has a CGI timeout function. Both default to 300 seconds. See your web server documentation for specific details.

We’re running under Apache, so that Timeout setting applies. Is there any reason not to set max_execution_time to zero globally? I’m mainly curious as to whether there are benefits I’m overlooking when not setting it to zero.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:42:06+00:00Added an answer on May 18, 2026 at 8:42 am

    At the risk of irritating you;

    You’re asking the wrong question. You don’t need a reason NOT to deviate from the defaults, but the other way around. You need a reason to do so. Timeouts are absolutely essential when running a web server and to disable that setting without a reason is inherently contrary to good practice, even if it’s running on a web server that happens to have a timeout directive of its own.

    Now, as for the real answer; probably it doesn’t matter at all in this particular case, but it’s bad practice to go by the setting of a separate system. What if the script is later run on a different server with a different timeout? If you can safely say that it will never happen, fine, but good practice is largely about accounting for seemingly unlikely events and not unnecessarily tying together the settings and functionality of completely different systems. The dismissal of such principles is responsible for a lot of pointless incompatibilities in the software world. Almost every time, they are unforeseen.

    What if the web server later is set to run some other runtime environment which only inherits the timeout setting from the web server? Let’s say for instance that you later need a 15-year-old CGI program written in C++ by someone who moved to a different continent, that has no idea of any timeout except the web server’s. That might result in the timeout needing to be changed and because PHP is pointlessly relying on the web server’s timeout instead of its own, that may cause problems for the PHP script. Or the other way around, that you need a lesser web server timeout for some reason, but PHP still needs to have it higher.

    It’s just not a good idea to tie the PHP functionality to the web server because the web server and PHP are responsible for different roles and should be kept as functionally separate as possible. When the PHP side needs more processing time, it should be a setting in PHP simply because it’s relevant to PHP, not necessarily everything else on the web server.

    In short, it’s just unnecessarily conflating the matter when there is no need to.

    Last but not least, ‘stillstanding’ is right; you should at least rather use set_time_limit() than ini_set().

    Hope this wasn’t too patronizing and irritating. Like I said, probably it’s fine under your specific circumstances, but it’s good practice to not assume your circumstances to be the One True Circumstance. That’s all. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there ever a good reason to not declare a virtual destructor for a
Are there any good reasons not to use \u0000 as a delimiter within a
Is there a good reason why there is no Pair<L,R> in Java? What would
Put differently: Is there a good reason to choose a loosely-typed collection over a
I'm sure there is a good (or at least decent) reason for this. What
apparently it works Can you name reasons beyond good practices not to give these
Are there good reasons why it's a better practice to have only one return
Are there good efficiency savings using Sql Server 2005 over Sql Server 2000? Or
Is there good example code or a test project for explaining the Model–view–presenter (MVP)
What are the tensions between multithreading and exception-safety in C++? Are there good guidelines

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.