On the fopen page (of php manual), you'll notice:
"Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because of this,
directories must include trailing slashes."
http://www.domain.com is not actually a valid path... apache realizes you
want http://www.domain.com/ and issues a header redirect. fopen cannot
handle the redirect.
-Thought I'd give a shot at a little explanation instead of just suggesting
the "/".
-Brian Tanner
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: August 28, 2001 11:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] Bug #12965 Updated: fopen() don't open URL files
ID: 12965
Updated by: sander
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Filesystem function related
Operating System: Windows2000
PHP Version: 4.0.6
New Comment:
I got a slightly different error:
Warning: fopen("http://www.php.net","r") - No error in
e:\sander\webserver\http\test\test1.php on line 10
If you append a / to the url, it works:
fopen("http://www.php.net/", "r")
The errors are a bit weird though...
Let's make it a bogus.
Previous Comments:
------------------------------------------------------------------------
[2001-08-26 10:45:23] [EMAIL PROTECTED]
I'm using PhP 4.0.6 with Apache 1.3 and the
problem is opening remote files with fopen("http://...");
The following code:
>$fp = fopen("http://www.php.net", "r") or die("OPEN");
>while (! feof($fp))
>{
> fread($fp, 1024) or die("READ");
>}
>fclose($fp) or die("CLOSE");
Produced the following output:
>Warning: php_hostconnect: connect failed in filename.php..
>
>Warning: fopen("http://www.php.net","r") - Bad file
>descriptor in filename.php..
I tried to use fsockopen() with my IE proxy and port settings - it was
successful. Maybe the problem is in Apache configuration, but I just can't
figure that out!
If you can help, please, send to my email: [EMAIL PROTECTED]
Kind regards
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12965&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]