#27105 [Com]: Cannot open remote URL's

From: Date: Thu, 02 Sep 2004 06:18:22 +0000
Subject: #27105 [Com]: Cannot open remote URL's
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65608@lists.php.net to get a copy of this message
ID: 27105 Comment by: maximander at gmail dot com Reported By: jprins at ision dot nl Status: No Feedback Bug Type: HTTP related Operating System: Unix PHP Version: 4.3.4 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2004-02-06 11:23:20] sniper@php.net 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-02-01 05:51:01] sniper@php.net 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) ------------------------------------------------------------------------ [2004-02-01 03:29:36] jprins at ision dot nl I don't think the weird characters in the error message are normal? Warning: readfile(http://www.ccmplanet.com/): failed to open stream: HTTP request failed! üESÆ@4Ìÿ¿>Æà\@@Ìÿ¿<™Æ in /home/sites/site90/web/testrss.php on line 5 ------------------------------------------------------------------------ [2004-01-31 23:41:13] sniper@php.net Works fine with latest CVS snapshot. Worked fine with PHP 4.2.2 too. :) ------------------------------------------------------------------------ [2004-01-31 13:15:11] jprins at ision dot nl Changed the include into readfile, but same result ------------------------------------------------------------------------ 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/27105 -- Edit this bug report at http://bugs.php.net/?id=27105&edit=1

« previous php.bugs (#65608) next »