I'm testing file_get_contents on my WAMP laptop (Windows Vista Home), and tried to use it to get the contents of Google, scripts are as below:
However I got the following errors:
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.Warning: file_get_contents(Google) [function.file-get-contents]: failed to open stream: HTTP request failed! in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testing\http.php on line 44
Fatal error: Maximum execution time of 10 seconds exceeded in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testing\http.php on line 44
What's wrong with the php.ini settings or wrong with the script?
well, if you want the content of the google webpage, you need to write it as an url, "http://www.google.com", not just google.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I do write http://www.google.com in the script, just can't understand why this site can automatically parse it to google. I tried several other urls, but got the same problem.
Can some expert help figure out what's wrong with the script or the settings in the php.ini in my wamp laptop?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks