WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP HTTP Error: Couldn't resolve host (24 posts)

  1. chrisncohen
    Member
    Posted 4 years ago #

    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 wordpress.org 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.

  2. chrisncohen
    Member
    Posted 4 years ago #

    this script does not work on that same site:

    <?php

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://www.randolphcollege.edu');
    curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');
    curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'read_body');
    curl_exec($ch);

    if ($error = curl_error($ch)) {
    echo "Error: $error
    \n";
    }

    function read_header($ch, $string)
    {
    $length = strlen($string);
    echo "Header: $string
    \n";
    return $length;
    }

    function read_body($ch, $string)
    {
    $length = strlen($string);
    echo "Received $length bytes
    \n";
    return $length;
    }
    echo file_get_contents("http://www.yahoo.com/index.html");
    ?>

  3. chrisncohen
    Member
    Posted 4 years ago #

    Actually, it works, it just returns the following:

    Error: Couldn't resolve host 'www.randolphcollege.edu'

  4. esmi
    Forum Moderator
    Posted 4 years ago #

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

  5. chrisncohen
    Member
    Posted 4 years ago #

    This works from the command line: curl http://www.google.com/
    returns the source from that page.

  6. chrisncohen
    Member
    Posted 4 years ago #

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

  7. esmi
    Forum Moderator
    Posted 4 years ago #

    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.

  8. Eric Mann
    Member
    Posted 4 years ago #

    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.

  9. chrisncohen
    Member
    Posted 4 years ago #

    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, 'http://72.14.204.104');)

    additionally, this works fine inside PHP on that server:

    print gethostbyname('bugs.php.net');

    returns "128.39.198.38"

  10. chrisncohen
    Member
    Posted 4 years ago #

  11. Eric Mann
    Member
    Posted 4 years ago #

    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 serverfault.com or superuser.com 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.

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

  13. Andrew Nacin
    Lead Developer
    Posted 4 years ago #

    You should download the Core Control plugin, http://wordpress.org/extend/plugins/core-control/, and test out the HTTP transports.

  14. Eric Mann
    Member
    Posted 4 years ago #

    +1 to Andrew's suggestion.

  15. 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.

  16. chrisncohen
    Member
    Posted 4 years ago #

    It's a fresh install of MU.

  17. chrisncohen
    Member
    Posted 4 years ago #

    The Core Control plugin died on me. It claimed "Plugin could not be activated because it triggered a fatal error." when I tried to activate it in the control panel. I sense that this is a DNS problem as well. We had quite a time with getting our domain controller WIN2003 server to deal up a wildcard DNS entry to that server which seems to be working for everything except the application it was created for...I appreciate everyone's suggestions. I'll see what the folks at serverfault and superuser have to say.

  18. Andrew Nacin
    Lead Developer
    Posted 4 years ago #

    What's the fatal error? I can't say I've used it on multisite but it should be fine based on my knowledge of it.

    [Edit, I take that back, I've used it in multisite, and it works fine...]

    That said, if you're still running MU (i.e. 2.9.x) and not 3.0 multisite, then yeah, the new version would not work.

    [Edit, maybe download an older tag...]

  19. chrisncohen
    Member
    Posted 4 years ago #

    The error was only as specific as what I put in quotes up there. It didn't seem to show up in the apache access or error logs. I tried activating in in both the plugins and the mu-plugins folder as well.

  20. chrisncohen
    Member
    Posted 4 years ago #

    This is wordpressMU 2.9.2 BTW according to the dashboard footer.

  21. chrisncohen
    Member
    Posted 4 years ago #

    Another little nugget: I ran the php/cURL script above from the command line since I have PHP installed as a cgi-binary as well and it worked when it doesn't work from the browser...heh...

  22. chrisncohen
    Member
    Posted 4 years ago #

    update: I tore down the MU install today and put WordPress 3.0 in its place. I installed the Core Control plugin turned on the HTTP Logging Module and discovered that it was indeed cURL that was having trouble resolving the host names in those widgets and RSS feeds. Still haven't figured out where the configuration glitch is.

  23. Andrew Nacin
    Lead Developer
    Posted 4 years ago #

    Glad you could get it working.

    You can disable the cURL transport and hopefully you'll have luck with one of the others. I'd test them all.

    If none work, then your server can't communicate to the world and you'll need to get that looked at.

  24. TelbitConsulting
    Member
    Posted 3 years ago #

    I got this message on two of my blogs just today. Something happened overnight. Host is Yahoo.

    WP HTTP Error: Couldn't resolve host 'wordpress.org'

    There are others issues associated with this too...like Akismet servers are not being found, etc. I called Yahoo since it seems to me (I am not a network geek) to be a server issue?

Topic Closed

This topic has been closed to new replies.

About this Topic