The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

curl misbehaving - cannot resolv hosts

Discussion in 'General Discussion' started by tskiller, Apr 16, 2006.

  1. tskiller

    tskiller Registered

    Joined:
    Jul 28, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hey, curl is currently not resolving hosts at all, however ping from cli works fine.

    For example:

    PHP:
    <?php

      $ch 
    curl_init("http://www.google.com");

      if (!
    curl_exec($ch)) {
        echo 
    "This should display the Google home page<br>";
        echo 
    "Error number:<br>";
        if (
    curl_errno($ch))
         print 
    curl_error($ch);
        }

      
    curl_close($ch);

    ?>
    Should bring up the google home page. However, it just displays:

     
  2. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    this may or may not help but we had a issue with php fsockopen that was doing basically the same thing

    the fix was to remove the http:// and just use www.domain.com
     
Loading...

Share This Page