473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

max-execution-time HTTP timeout ?

Hi NG,

I have my own apache server 2.0.54 running with php 4.3.10.

I got a little logical problem here about http requests.

I have written a small php script which waits for x seconds. Every
second it appends the seconds to a file.

I expected a timeout after 300 seconds, becouse apache is configured
like that. But until now it doesn't matter. I can wait for more than 5
minutes and the script finishes i see the result page.

Why my browser doesn't get a timeout. Which part is responsible for a
timeout???

One said that it is configurable over the directive max-execution-time
in php.ini. BUT this one is set to 30 seconds. The timeout directive in
httpd.conf is 300 seconds.

One apache group user said, that maybe the max-execution-time of
php.ini maybe only applies to CPU time (non-sleeping).

How I can prevent scripts of running endless??? Which parts are
responsible?

Here the code:

<?php

// All print functions do not show up on the screen until it is
finished
print 'Now we wait<br>';

for($i = 1; $i <= 360; ++$i) {
sleep(1);
print "$i<br>";
$handle = fopen('test.dat', "a");
fwrite($handle, $i . "\n");
fclose($handle);
}

print '<br><br>End...<br>';

?>

Thanks...

Nov 22 '05 #1
2 9579
On 18.11.2005 11:37, hakim wrote:
Hi NG,

I have my own apache server 2.0.54 running with php 4.3.10.

I got a little logical problem here about http requests.

I have written a small php script which waits for x seconds. Every
second it appends the seconds to a file.

I expected a timeout after 300 seconds, becouse apache is configured
like that. But until now it doesn't matter. I can wait for more than 5
minutes and the script finishes i see the result page.

Why my browser doesn't get a timeout. Which part is responsible for a
timeout???

One said that it is configurable over the directive max-execution-time
in php.ini. BUT this one is set to 30 seconds. The timeout directive in
httpd.conf is 300 seconds.

One apache group user said, that maybe the max-execution-time of
php.ini maybe only applies to CPU time (non-sleeping).

How I can prevent scripts of running endless??? Which parts are
responsible?

Here the code:

<?php

// All print functions do not show up on the screen until it is
finished
print 'Now we wait<br>';

for($i = 1; $i <= 360; ++$i) {
sleep(1);
print "$i<br>";
$handle = fopen('test.dat', "a");
fwrite($handle, $i . "\n");
fclose($handle);
}

print '<br><br>End...<br>';

?>

Thanks...


It's strange, looks like apache ignores your php.ini. You can yet try to
add set_time_limit(30); to the beginning of your code. After 30 seconds
the script should end with php generated-error, so the last line never
prints. If set_time_limit will work, try to find if you are not using
another php.ini than you are trying to edit ;)

Y.
Nov 22 '05 #2
Hi,

I want to configure php and the webserver not to let run scripts
endless like mine. So I don't want to tell my friends on my server to
do it like that, because they are users and I can't trust on that.

I checked with phpinfo(); the path to php.ini:

Configuration File (php.ini) Path: /etc/php4/apache2/php.ini

And that's the php.ini i am working with.

I got a debian sarge installation. So there must be a way to configure
what i want.

I hope.

Thanks...

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steven Bethard | last post by:
So I've been playing around with trying to add a keyword argument to min and max that works similarly to the one for sorted. It wasn't too hard actually, but it does raise a few questions about...
2
by: Jack | last post by:
Greetings folks, Just curious if anyone knows what the following would produce: SELECT MAX( ECP_SUPPORT_DED_EMAIL.CD_TYP_CMPGN) CD_TYP_CMPGN, MAX(ECP_SUPPORT_DED_EMAIL.CELL_ID) CELL_ID,...
5
by: Bayla Frankl | last post by:
Hi all, I am a little stumped. I have a query I am trying to run to retrieve the last Progress Note record from the database for the current patient so that the therapists can see the last note...
8
by: charles.amith | last post by:
I have 2 tables: LOCATION and ELEVATION In location, I would like to find the record with the max value for field: DATE1 In elevation, I would like to find the record with the max value for...
61
by: norb1 | last post by:
After tracking down a bug in my Fortran program, I found that it assumed max(NaN,0.) = 0. This makes no sense, as the outcome of the operation is undefined and should be NaN. max(NaN,0.) = NaN...
38
by: copx | last post by:
Are the macros min() and max() part of stdlib.h or not? (according to the standard?) I have the following problem: I defined my own min() / max() macros because my compiler (MinGW) does NOT...
19
by: Eugeny Myunster | last post by:
I know, only simple one: #include <stdio.h> int main() { int min=0,max=0,i,arr; for(i=0;i<12;i++) arr=rand()%31-10; for(i=0;i<12;i++)
54
by: bearophileHUGS | last post by:
Empty Python lists don't know the type of the items it will contain, so this sounds strange: 0 Because that may be an empty sequence of someobject: 0 In a statically typed language in...
0
by: hong.niu4 | last post by:
please look our website ,have more mode shoes clothing hat cap bags ! Air Max Air Max 87 shoes www.shoestrade.biz Air Max 90 shoes www.shoestrade.biz Air Max 91 shoes www.shoestrade.biz Air...
6
by: rahulsengupta895 | last post by:
. #define MIN(a,b) (a<b?a:b) #define MAX(a,b) (a>b?a:b) #include "Video.h" #define NO_HUE -1
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.