RE: [PHP-DEV] Bug #12965 Updated: fopen() don't open URL files

From: Date: Tue, 28 Aug 2001 20:50:30 +0000
Subject: RE: [PHP-DEV] Bug #12965 Updated: fopen() don't open URL files
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64540@lists.php.net to get a copy of this message
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: sander@php.net [mailto:sander@php.net] Sent: August 28, 2001 11:25 AM To: php-dev@lists.php.net Subject: [PHP-DEV] Bug #12965 Updated: fopen() don't open URL files ID: 12965 Updated by: sander Reported By: ronaldo@inbox.lv 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] ronaldo@inbox.lv 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: ronaldo@inbox.lv 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: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#64540) next »