ID: 40197
Updated by: tony2001@php.net
Reported By: ddrewery at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: HTTP related
Operating System: Fedora Core 6
PHP Version: 5.2.0
New Comment:
Please make sure you don't have any firewalls blocking your
connections.
Previous Comments:
------------------------------------------------------------------------
[2007-01-22 17:18:38] ddrewery at gmail dot com
http://teton1w.tetonsolutions.com/geo/yh/test2.php
runs the posted
code.
------------------------------------------------------------------------
[2007-01-22 17:16:41] ddrewery at gmail dot com
Description:
------------
Anytime I try accessing an external file via wrappers (fopen,
file_get_contents,...), I get "failed to open stream: HTTP request
failed!". I have "allow_url_fopen = On" and phpinfo() shows this is
correct. It doesn't matter what file, if its not on the local server,
it will not work.. even trying to load google.com.. same result.
I have two identical servers, both using FC6.. I upgraded from 5.1.6 to
5.2 on one of them and still have the same issue. I currenly have ZEND
Optomizer enabled but I installed it after this issue stated (thinking
it may help).
I can use fsocketopen and make the code work just fine, but anything
using fopen wrappers fails.
SELinux is disabled on this machine as well.
http://teton1w.tetonsolutions.com/geo/yh/phpinfo.php
Reproduce code:
---------------
<?php
function loadXFile($location) {
$q = $location;
$tmp = file_get_contents($q);
return $tmp;
}
print loadXFile("http://www.google.com");
?>
Actual result:
--------------
Warning: file_get_contents(http://www.google.com)
[function.file-get-contents]: failed to open stream: HTTP request
failed! in /home/twhomes/httpdocs/geo/yh/test2.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40197&edit=1