|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27105 Cannot open remote URL's
Submitted: 2004-01-31 08:47 UTC Modified: 2004-02-06 11:23 UTC
Avg. Score:4.4 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:2 (28.6%)
From: jprins at ision dot nl Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 4.3.4 OS: Unix
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jprins at ision dot nl
New email:
PHP Version: OS:


 [2004-01-31 08:47 UTC] jprins at ision dot nl
PHP issues this warning:

Warning: main( failed to open stream: HTTP request failed! in /home/sites/site90/web/testrss.php on line 17

Warning: main(): Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /home/sites/site90/web/testrss.php on line 17

The weird thing is that this error only occurs on the 
combination of my server ( and 
the remote server ( 

I _can_ include other remote URL's and other sites that 
also use php-include from don't have problems accessing

Reproduce code:

Code in this file:


Expected result:
It should just include the file (it worked for years, but since a few hours it stopped working, I suspect my hosting provider from changing (upgrading?) the system).
Yes, I already asked what they did (no reply sofar)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-31 10:46 UTC] jprins at ision dot nl
Tom, thanks for the quick response, the page still fails on my system.

Here's a link to phpinfo.
 [2004-01-31 12:25 UTC]
(1) In your test script dump the contents of $http_response_header, not $http_response_headers.

(2) Use readfile() when all you're including is content and not actual PHP code.  Using include() on a remote URL which you don't control is a security risk and a completely unnecessary one in this context.
 [2004-01-31 13:15 UTC] jprins at ision dot nl
Changed the include into readfile, but same result
 [2004-01-31 23:41 UTC]
Works fine with latest CVS snapshot. Worked fine with PHP 4.2.2 too. :)

 [2004-02-01 03:29 UTC] jprins at ision dot nl
I don't think the weird characters in the error message are

Warning: readfile( failed to open stream: HTTP request failed! ?ES?@4???>??\@@???<?? in /home/sites/site90/web/testrss.php on line 5
 [2004-02-01 05:51 UTC]
Why does it work fine for me? Using this script:


I get the page contents and the correct headers..
So what is different? (I'm running the script with CLI)

 [2004-02-06 11:23 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

..and you should fix your server..

 [2004-09-02 08:18 UTC] maximander at gmail dot com
We at are also encountering this error. Using a packet sniffer and file(), as well as fsockopen() we tracked the problem to the fact that php is not sending a 'Host:' header, nor the double line return to mark the end of headers, but rather is stopping after the first line ("GET .... HTTP/1.0")
we have several questions:
1) shouldn't it use http/1.1 ?
2) why isn't it sending all the headers?
3) Why does it retry the "GET ..." several times rather than finishing the first one?
4) What the $#%^ are those funny characters in the error msg?

using fsockopen() we can send the "GET ..." and "Host..." headers manually and the request works fine.

PHP Version: 4.3.8
OS: Gentoo Linux(2.6.7 kernel)
Apache 2
Tried php 5.0.1,'--enable-debug' and yes, allow_url_fopen is set to On. 

email me if you want more specific info.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 21:01:33 2024 UTC