WAMP file_get_contents($url) problem

I’m testing file_get_contents on my WAMP laptop (Windows Vista Home), and tried to use it to get the contents of www.google.com, scripts are as below:

set_time_limit(10);
$result = file_get_contents(“http://www.google.com”);

echo $result;

However I got the following errors:

Warning: file_get_contents(http://www.google.com) [function.file-get-contents]: failed to open stream: HTTP request failed! in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ esting\http.php on line 44

Fatal error: Maximum execution time of 10 seconds exceeded in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ esting\http.php on line 44

The allow_url_fopen is on in the php.ini, and tried change the set_time_limit to bigger or less, still the same errors.

What’s wrong with the php.ini settings or wrong with the script?

Have you tried a different URL?

Of course I tried several sites. Help please.

try remove set_time_limit(10);

No, it’s not working. It’s easy to get the contents of local file on my computer. For example, it’s very fast to show echo file_get_contents(“test.txt”).