Closed Thread
Results 1 to 4 of 4

Thread: WAMP file_get_contents($url) problem

  1. #1
    hhheng is offline Newbie
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    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 Google, scripts are as below:
    set_time_limit(10);
    $result = file_get_contents("Google");
    echo $result;
    However I got the following 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
    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?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: WAMP file_get_contents($url) problem

    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

  4. #3
    hhheng is offline Newbie
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Re: WAMP file_get_contents($url) problem

    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.

  5. #4
    hhheng is offline Newbie
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Re: WAMP file_get_contents($url) problem

    Can some expert help figure out what's wrong with the script or the settings in the php.ini in my wamp laptop?

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Warning: file_get_contents() [function.file-get-contents]
    By Bioshox in forum PHP Development
    Replies: 1
    Last Post: 09-22-2011, 03:13 AM
  2. Problem with wamp 2.1
    By thatsme in forum PHP Development
    Replies: 2
    Last Post: 05-21-2011, 01:15 PM
  3. How Do You Go About Setting Up WAMP?
    By throese in forum Software Development Tools
    Replies: 6
    Last Post: 08-04-2010, 11:00 AM
  4. File_get_contents problem
    By webcodez in forum PHP Development
    Replies: 1
    Last Post: 03-08-2010, 03:30 PM
  5. HELP! - file_get_contents
    By maros174 in forum PHP Development
    Replies: 2
    Last Post: 03-02-2010, 02:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts