Support » Fixing WordPress » WP HTTP Error: Couldn't resolve host

  • Resolved chrisncohen


    I’ve got a brand new install of WPMU on a server here with no plugins or any data to speak of. When I go to the dashboard home page I’m getting the “WP HTTP Error: Couldn’t resolve host” in the RSS feeds section. I can’t add rss feeds in the sidebar widget either. nslookup, ping, and dig all work fine from that server. Additionally, when I went to install the buddypress plugin by searching for it in the plugin installer in the wp-admin area I got this error: “An Unexpected HTTP Error occurred during the API request.” The section called “Popular tags” on that page (wp-admin/plugin-install.php) was also empty. Any help would be appreciated.

Viewing 15 replies - 1 through 15 (of 23 total)
  • this script does not work on that same site:


    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, ‘’);
    curl_setopt($ch, CURLOPT_HEADERFUNCTION, ‘read_header’);
    curl_setopt($ch, CURLOPT_WRITEFUNCTION, ‘read_body’);

    if ($error = curl_error($ch)) {
    echo “Error: $error

    function read_header($ch, $string)
    $length = strlen($string);
    echo “Header: $string
    return $length;

    function read_body($ch, $string)
    $length = strlen($string);
    echo “Received $length bytes
    return $length;
    echo file_get_contents(“”);

    Actually, it works, it just returns the following:

    Error: Couldn’t resolve host ‘’



    Forum Moderator

    It sounds me like you have a server configuration issue and the server is refusing to contact external sites.

    This works from the command line: curl
    returns the source from that page.

    also, ping, dig, and nslookup are working fine from that server.



    Forum Moderator

    Sever configuration is not my area of expertise but it looks like cUrl isn’t enabled for PHP if it will run from commandline but not from a script. So it’s either a PHP setup issue or something that sits between PHP & the server shell is mis-configured and is blocking external calls.

    I’ll see if I can get a few of the regulars with more server admin experience to drop into this thread and lend a hand.

    Can you create a phpinfo page and link that to this post so we can see what’s currently configured? Just create a page called phpinfo.php which contains the following line:

    <?php phpinfo() ?>

    And upload it to your site via FTP. This will tell us a little about how your server is configured and whether or not cURL is enabled.

    I’d appreciate that greatly. FYI when I run the php script above with an ip address in it, it returns valid headers, which suggests that cURL is enabled and working fine. (e.g. the line curl_setopt($ch, CURLOPT_URL, ‘’);)

    additionally, this works fine inside PHP on that server:

    print gethostbyname(‘’);

    returns “”

    Looking at your configuration, and reading your latest post about how cURL works via IP but not hostname, I’m at a total loss. I’d recommend posting your situation on either or and seeing if a pro over there can help (then make sure you copy the solution over here for people who might need it as well).

    The thing that bothers me the most is that this is an .edu site … some educational institutions have complex server setups that break WordPress very easily … I’m hoping you’re not in that boat, too.

    Andrea Rennick


    Customer Care at Copyblogger Media and Studiopress

    Are you running an upgraded MU install? Or did you install 3,.0 fresh?

    Moderator Andrew Nacin


    Lead Developer

    You should download the Core Control plugin,, and test out the HTTP transports.

    +1 to Andrew’s suggestion.

    Moderator Mark Ratledge


    Forum Moderator

    If there’s a difference between using the domain and the IP, and coupled with the fact that it’s a subdoman, I’d say it sounds like DNS. Might be time for serverfault, as suggested.

    It’s a fresh install of MU.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘WP HTTP Error: Couldn't resolve host’ is closed to new replies.