From: ddrewery at gmail dot com Operating system: Fedora Core 6 PHP version: 5.2.0 PHP Bug Type: HTTP related Bug description: Cannot access remote files
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 bug report at http://bugs.php.net/?id=40197&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40197&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40197&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40197&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40197&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40197&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40197&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40197&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40197&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40197&r=support Expected behavior: http://bugs.php.net/fix.php?id=40197&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40197&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40197&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40197&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40197&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40197&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40197&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40197&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40197&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40197&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40197&r=mysqlcfg