PHP: what happens if required script stops because of timeout

Scenario: a php script with som pre-code, a require xxxx.php; and some postcode. Wanting and believing that because of using require and not include, the script will stop at the "require" statement if xxxx.php times out - is that correct?

Or asked in another way: is a timeout the same as the script throwing an error?

Answers


From the documentation:

max_execution_time integer

This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. When running PHP from the command line the default setting is 0.

The maximum execution time is not affected by system calls, stream operations etc. Please see the set_time_limit() function for more details.

You can not change this setting with ini_set() when running in safe mode. The only workaround is to turn off safe mode or by changing the time limit in the php.ini.

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.

Official Documentation for set_time_limit()


Need Your Help

Javascript: Count visible characters in div

javascript jquery html count

I have a div which contains text (a string of length S) of an arbitrary length, but a fixed size. Beyond a certain length (let's call it L), the text is truncated and the remainder of the text is no

jquery show / hide multiple elements by id

jquery click hide show

I have 3 paragraph and 2 buttons which are next / previous. On initial load the user can only see the first paragraph and a next button, unless he is on paragraph 2 there will be a next and a previ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.