ID: 22297 User updated by: sp at m-me dot dk Reported By: sp at m-me dot dk -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: Windows PHP Version: 4.3.2-dev New Comment:
The script supplied gives the right output, but still takes "default_socket_timeout * 2" seconds. I found that if I removed the first line "set_time_limit(600);" the script faild again - Still I could not get rid of the long timeout. The output from the code was: -------------------------------------------------- array(1) { [0]=> string(6) "foobar" } array(9) { [0]=> string(15) "HTTP/1.1 200 OK" [1]=> string(35) "Date: Fri, 21 Feb 2003 00:43:31 GMT" [2]=> string(29) "Server: Apache/2.0.43 (Win32)" [3]=> string(44) "Last-Modified: Tue, 18 Feb 2003 15:48:22 GMT" [4]=> string(23) "ETag: "37a6-6-d5528ab3"" [5]=> string(20) "Accept-Ranges: bytes" [6]=> string(17) "Content-Length: 6" [7]=> string(17) "Connection: close" [8]=> string(44) "Content-Type: text/plain; charset=ISO-8859-1" } -------------------------------------------------- The output from the curl command (had to install Cygwin) was: -------------------------------------------------- $ curl -i http://localhost/test/readfile/test.txt HTTP/1.1 200 OK Date: Fri, 21 Feb 2003 00:41:16 GMT Server: Apache/2.0.43 (Win32) Last-Modified: Tue, 18 Feb 2003 15:48:22 GMT ETag: "37a6-6-d5528ab3" Accept-Ranges: bytes Content-Length: 6 Content-Type: text/plain; charset=ISO-8859-1 foobar -------------------------------------------------- Previous Comments: ------------------------------------------------------------------------ [2003-02-20 14:39:52] [EMAIL PROTECTED] Your system has determined two alternative addresses to attempt to contact for localhost and it attempts each alternative for default_socket_timeout in seconds. For some reason it is not connecting successfully. Please try the following script: <?php set_time_limit(600); ini_set('default_socket_timeout', 5); $x = file("http://localhost/test.txt"); var_dump($x); var_dump($http_response_header); ?> and report back here. It would also help if you could try fetching the same url using: curl -i http://localhost/test.txt and paste the output here. ------------------------------------------------------------------------ [2003-02-20 06:42:29] sp at m-me dot dk When setting default_socket_timeout to... 5 the script runs in 10 10 the script runs in 20 60 the script runs in 120 With all of the above the script still ends up showing: Fatal error: Maximum execution time of 5 seconds exceeded in C:\wwwroot\test\readfile\read.php on line 3 ...when trying to read a file from a URL. ------------------------------------------------------------------------ [2003-02-19 19:03:34] [EMAIL PROTECTED] Forget getting newer snapshot, just try adjusting that php.ini directive.. ------------------------------------------------------------------------ [2003-02-19 19:02:48] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip And check that your php.ini has this setting: default_socket_timeout = 60 If not, add it and try again.. ------------------------------------------------------------------------ [2003-02-19 17:29:03] sp at m-me dot dk I've tried the latest stable windows release (4.3.2-dev) on System 1, but with the same results. By the way. I must have been a little tired when writing about the symtoms from system 1 and 2. They are instead like this: No matter what the maximum PHP execution time is set to, the script is running in 2 minutes before it stops and writes: Fatal error: Maximum execution time of 5 seconds exceeded in C:\wwwroot\test\readfile\read.php on line 3 In this example the max PHP execution time is set to 5 sec, but first after 2 min the script stops. The Apache timeout is set to 300 sec (5 min). For some reason I found that it is not always that the webservers error log contain any information about the event. But when it does it looks like this: [Wed Feb 19 16:14:31 2003] [error] [client 127.0.0.1] Premature end of script headers: php.exe With Apache 2.0.43 and Windows I've tested this on the following PHP versions: 4.2.3 No output to the browser, Internal Server Error 4.3.0 Error message outputted to browser after 2 min 4.3.1 Error message outputted to browser after 2 min 4.3.2-dev Error message outputted to browser after 2 min /watson ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22297 -- Edit this bug report at http://bugs.php.net/?id=22297&edit=1