[PHP-BUG] Bug #51852 [NEW]: file_get_contents not working with hhtp urls
From: Operating system: windows server 2008 64 bits PHP version: 5.2.13 Package: Streams related Bug Type: Bug Bug description:file_get_contents not working with hhtp urls Description: file_get_contents("http://www.php.net";); reports : failed to open stream: Une tentative de connexion a échoué car le parti connecté n'a pas répondu convenablement au-delà d'une certaine durée ou une connexion établie a échoué car l'hôte de connexion n'a pas répondu. -- Edit bug report at http://bugs.php.net/bug.php?id=51852&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51852&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51852&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51852&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51852&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51852&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51852&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51852&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51852&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51852&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51852&r=support Expected behavior: http://bugs.php.net/fix.php?id=51852&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51852&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51852&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51852&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51852&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51852&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51852&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51852&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51852&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51852&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51852&r=mysqlcfg
Bug #51852 [Bgs]: file_get_contents not working with hhtp urls
Edit report at http://bugs.php.net/bug.php?id=51852&edit=1 ID: 51852 User updated by: laurent at roussanne dot com Reported by: laurent at roussanne dot com Summary: file_get_contents not working with hhtp urls Status: Bogus Type: Bug Package: Streams related Operating System: windows server 2008 64 bits PHP Version: 5.2.13 New Comment: I worked to find a workaround all the last weekend. the solution was writing this : function win64_file_get_contents($url, $timeout=5) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); if (is_bool($file_contents) && ($file_contents == FALSE)) { return FALSE; } else { return $file_contents; } } I'm sure you know this code (found on the web). Do you have a windows 2008 64 test platform ? Previous Comments: [2010-05-18 16:27:20] paj...@php.net Works just fine. Verify your network connections or whatever you use to connect to internet. I suppose a simple: file_get_contents("http://127.0.01/";); will work just fine too for you (as long as you have 127.0.0.1 define). [2010-05-18 16:21:34] laurent at roussanne dot com Description: file_get_contents("http://www.php.net";); reports : failed to open stream: Une tentative de connexion a échoué car le parti connecté n'a pas répondu convenablement au-delà d'une certaine durée ou une connexion établie a échoué car l'hôte de connexion n'a pas répondu. -- Edit this bug report at http://bugs.php.net/bug.php?id=51852&edit=1
Bug #51852 [Bgs]: file_get_contents not working with hhtp urls
Edit report at http://bugs.php.net/bug.php?id=51852&edit=1 ID: 51852 User updated by: laurent at roussanne dot com Reported by: laurent at roussanne dot com Summary: file_get_contents not working with hhtp urls Status: Bogus Type: Bug Package: Streams related Operating System: windows server 2008 64 bits PHP Version: 5.2.13 New Comment: allow_url_include On On It is not a network problem because curl based workaround works ! I'm sure it is a windows 64 bits specific problem (2008 server, vista, or seven). Previous Comments: [2010-05-18 16:38:13] paj...@php.net Yes, windows is my main platform. Did you allow allow_url_fopen in your php.ini? But again: It does work. If it does not, then something is wrong in your configuation. [2010-05-18 16:34:53] laurent at roussanne dot com I worked to find a workaround all the last weekend. the solution was writing this : function win64_file_get_contents($url, $timeout=5) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); if (is_bool($file_contents) && ($file_contents == FALSE)) { return FALSE; } else { return $file_contents; } } I'm sure you know this code (found on the web). Do you have a windows 2008 64 test platform ? [2010-05-18 16:27:20] paj...@php.net Works just fine. Verify your network connections or whatever you use to connect to internet. I suppose a simple: file_get_contents("http://127.0.01/";); will work just fine too for you (as long as you have 127.0.0.1 define). -------- [2010-05-18 16:21:34] laurent at roussanne dot com Description: file_get_contents("http://www.php.net";); reports : failed to open stream: Une tentative de connexion a échoué car le parti connecté n'a pas répondu convenablement au-delà d'une certaine durée ou une connexion établie a échoué car l'hôte de connexion n'a pas répondu. -- Edit this bug report at http://bugs.php.net/bug.php?id=51852&edit=1
Bug #51852 [Bgs]: file_get_contents not working with hhtp urls
Edit report at http://bugs.php.net/bug.php?id=51852&edit=1 ID: 51852 User updated by: laurent at roussanne dot com Reported by: laurent at roussanne dot com Summary: file_get_contents not working with hhtp urls Status: Bogus Type: Bug Package: Streams related Operating System: windows server 2008 64 bits PHP Version: 5.2.13 New Comment: perhaps a French windows 2008 server OS specific issue ? The bug appears even with the command line interface. Previous Comments: [2010-05-18 16:56:15] paj...@php.net It is not. It works (win7/2k8/2k8R2, x64 or x86). Please ask further support on php-windows or php-general mailing list. [2010-05-18 16:43:18] laurent at roussanne dot com allow_url_include On On It is not a network problem because curl based workaround works ! I'm sure it is a windows 64 bits specific problem (2008 server, vista, or seven). [2010-05-18 16:38:13] paj...@php.net Yes, windows is my main platform. Did you allow allow_url_fopen in your php.ini? But again: It does work. If it does not, then something is wrong in your configuation. [2010-05-18 16:34:53] laurent at roussanne dot com I worked to find a workaround all the last weekend. the solution was writing this : function win64_file_get_contents($url, $timeout=5) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); if (is_bool($file_contents) && ($file_contents == FALSE)) { return FALSE; } else { return $file_contents; } } I'm sure you know this code (found on the web). Do you have a windows 2008 64 test platform ? [2010-05-18 16:27:20] paj...@php.net Works just fine. Verify your network connections or whatever you use to connect to internet. I suppose a simple: file_get_contents("http://127.0.01/";); will work just fine too for you (as long as you have 127.0.0.1 define). 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/bug.php?id=51852 -- Edit this bug report at http://bugs.php.net/bug.php?id=51852&edit=1