#22937 [Fbk->Opn]: Valid http:// URL does not open with fopen()

From: Date: Mon, 09 Jun 2003 15:33:14 +0000
Subject: #22937 [Fbk->Opn]: Valid http:// URL does not open with fopen()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-41537@lists.php.net to get a copy of this message
ID: 22937 User updated by: freddie at bingham dot net Reported By: freddie at bingham dot net -Status: Feedback +Status: Open Bug Type: Sockets related Operating System: Redhat 7.3 PHP Version: 4.3.2 New Comment: NULL The fact that you are asking me this implies that it works for you on 4.3.2 or you are unable to test it on 4.3.2. Is that the case? Previous Comments: ------------------------------------------------------------------------ [2003-06-09 09:41:10] wez@php.net *sigh* Please provide the information I requested. <?php $p = fopen('http://pub133.ezboard.com/bonesixthwarriors', 'rb'); var_dump($http_response_headers); ?> and paste the result here. ------------------------------------------------------------------------ [2003-06-09 09:19:19] freddie at bingham dot net Can we please stick to the bug that I have reported. Thanks. My script works in everything before 4.3.0. What had changed to break a valid URL from being opened with fopen() and why was I told it was fixed in the PRE released 4.3.2, to only find it is still broken in 4.3.2 ------------------------------------------------------------------------ [2003-06-09 03:17:27] wez@php.net dunkel at calamus dot net: fopen will raise a warning if it could not open the file. That is how it works. To hide the warning, use the @ operator. freddie at bingham dot net: please try this little script: $p = fopen('http://pub133.ezboard.com/bonesixthwarriors', 'rb'); var_dump($http_response_headers); and paste the result here ------------------------------------------------------------------------ [2003-06-09 01:29:22] dunkel at calamus dot net In my problem case, the remote file does NOT exist. This is what I want to find out with fopen(). The according code looks like this: // don't check remote files with file_exists() !!! if ($lan == "cz") { $file = fopen("$url_docu", "rb"); if ($file) { echo "<blockquote>\n"; echo "<a href=\"$url_docu\" class=\"h4\">"; $this->echo_name($lan); echo " (HTML)</a>\n"; echo "</blockquote>\n"; fclose($file); } else [...] } In fact, $file is invalid here as it should. But in no case this function call of fopen() should give a warning about this, shouldn't it? In http://www.calamus.net/cz/modules/aln.php, you see how it works with existing remote files. In http://www.calamus.net/us/modules/aln.php, you can see how the result should be (refer to 'Manual' instead of the Czech 'Prirucka'). ------------------------------------------------------------------------ [2003-06-08 20:15:31] freddie at bingham dot net It very well does exist. Perhaps you just clicked on the url as presented on this page which adds a ', to the end. ------------------------------------------------------------------------ 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/22937 -- Edit this bug report at http://bugs.php.net/?id=22937&edit=1

« previous php.bugs (#41537) next »