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] [email protected]
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