|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-01-31 08:47 UTC] jprins at ision dot nl
Description: ------------ PHP issues this warning: Warning: main(http://www.ccmplanet.com/): failed to open stream: HTTP request failed! in /home/sites/site90/web/testrss.php on line 17 Warning: main(): Failed opening 'http://www.ccmplanet.com/' 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 (http://www.refresh.cx) and the remote server (http://www.ccmplanet.com). I _can_ include other remote URL's and other sites that also use php-include from ccmplanet.com don't have problems accessing ccmplanet.com Reproduce code: --------------- URL: http://www.refresh.cx/testrss.php Code in this file: <?php include("http://www.ccmplanet.com/"); var_dump($http_response_headers); ?> 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) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 09:00:02 2025 UTC |
Why does it work fine for me? Using this script: <?php readfile("http://www.ccmplanet.com/"); var_dump($http_response_headers); ?> I get the page contents and the correct headers.. So what is different? (I'm running the script with CLI)We at gerpok.com 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.