php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11204 readfile/file fail if HTTP header is not returned
Submitted: 2001-05-30 20:34 UTC Modified: 2001-09-09 10:10 UTC
From: dhubbard at dino dot hostasaurus dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.0.5 and 4.0.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dhubbard at dino dot hostasaurus dot com
New email:
PHP Version: OS:

 

 [2001-05-30 20:34 UTC] dhubbard at dino dot hostasaurus dot com
Use readfile("http://www.internic.net") and it works fine,
returning the InterNIC web page.  Use readfile("http://www.internic.net/cgi/whois?whois_nic=blah.com&type=domain")
against their page, which is a valid GET-request URL and
works great from a browser and readfile doesn't work.  I
dug a little deeper and did a packet capture while trying
my PHP page with both URL's.  Both URL's return just fine
in the packet capture, complete information, so why does
the second URL with the query not work?  The absolute
only difference I can see in the packet capture that could
make a difference here is that the  normal pages are
returned with a HTTP/1.1.200 on the top whereas the other
URL is missing the HTTP response code!  I'm not sure if
it's legal HTTP for that code to be missing but could
that be the problem?

Thanks,

Dave Hubbard

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-30 22:31 UTC] sniper@php.net
Reproduced with PHP 4.0.5RC1 and marked as fix before release.

--Jani

 [2001-05-30 22:32 UTC] sniper@php.net
Of course I mean't 4.0.6RC1..


 [2001-06-29 13:25 UTC] dhubbard at dino dot hostasaurus dot com
The comments on this bug ID show that it should have been fixed in 4.0.6RC1 but it has not been fixed in the release version 4.0.6.
 [2001-09-09 10:10 UTC] stas@php.net
The page you have problem with does not return HTTP status line in the response, as describe in HTTP protocol description. Meaning, this site has broken HTTP implementation. Please contact the administrator of the server and ask them to fix their server to comply with HTTP standards. 
If you absolutely need to work with this broken server, you might use socket functions (fsockopen and friends) and talk to it directly. readfile() function is meant to communicate with HTTP servers which should speak HTTP as mandated by the standards.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC