From:             sp at m-me dot dk
Operating system: Windows
PHP version:      4.3.1
PHP Bug Type:     Filesystem function related
Bug description:  Timeout when reading file from URL

When using the function file() or file_get_contents() added in PHP 4.3.0 I
have a problem when I try to read a URL instead of reading directly from
the filesystem.

This works fine:
file("test.txt");

This creates an "Internal Server Error" the webserver:
file("http://localhost/test.txt";);

I've testet this on 3 different systems:
System 1:
----------------------------------------
Windows XP Pro sp1
Apache 2.0.43
PHP 4.3.1

System 2:
----------------------------------------
Windows 2000 Server (build 5002195) sp3
Apache 2.0.43
PHP 4.3.0

System 3:
----------------------------------------
Linux 2.4.20
Apache 1.3.27
PHP 4.3.1


This is what happend on the 3 systems:
System 1:
----------------------------------------
The browser is loading for about 5 minutes (more than the the maximum PHP
execution time!?) then displays an "Internal Server Error" and writes this
in the webserver error log:

[Wed Feb 19 14:54:40 2003] [error] [client 127.0.0.1] Premature end of
script headers: php.exe, referer: http://localhost/test/readfile/

System 2:
----------------------------------------
The browser is loading for 30 sec. (the maximum PHP execution time) and
then displays this in the browser:

Fatal error: Maximum execution time of 30 seconds exceeded in
C:\data\htdocs\fil1.php on line 3

and this in the webserver error log:
[Wed Feb 19 15:32:41 2003] [error] [client 127.0.0.1] Premature end of
script headers: php.exe, referer: http://localhost/

System 3:
----------------------------------------
On the this system (the Linux system) both examples worked without any
errors. Besides the operating system the biggest difference between the
other systems and this one is the Apache version. Could it be Apache 2.x
vs. PHP 4.3.x that was the problem?

/watson
-- 
Edit bug report at http://bugs.php.net/?id=22297&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22297&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22297&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22297&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22297&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22297&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22297&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22297&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22297&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22297&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22297&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22297&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22297&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22297&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22297&r=gnused

Reply via email to