WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] An Unexpected HTTP Error occurred during the API request on WordPress 3 (48 posts)

  1. mixmastermichael
    Member
    Posted 3 years ago #

    Ah, another note: disabled PHP streams, disabled, fopen(), kept fsock enabled, where it then had the "get" stuff:

    Primary GET
    Primary POST
    Primary GET(non-blocking)
    Primary POST(non-blocking)

    and it now seems to be working to upgrade / install new plugins and themes! ... Still can't upgrade automatically to wordpress 3.1, but I've never really had much luck with that before in the first place. Will post again if I still run into issues.

    Thanks so much for the help!
    Mike

  2. Dion Hulse
    WordPress Dev
    Posted 3 years ago #

    and it now seems to be working to upgrade / install new plugins and themes! ... Still can't upgrade automatically to wordpress 3.1, but I've never really had much luck with that before in the first place. Will post again if I still run into issues.

    What error message are you getting on upgrade attempts?

  3. reinharddeman
    Member
    Posted 3 years ago #

    Hey Mixmastermichael & dion! I have exacly the same problem since this week.. also working with byethost..

  4. mixmastermichael
    Member
    Posted 3 years ago #

    Hi reinharddeman - thanks for posting, gotta be something with the byethost then, if you follow what I did and disable the PHP stream and fpopen() it should work.

    Dion - the error message I get is

    Download failed.: Could not open handle for fopen() to http://wordpress.org/wordpress-3.1.zip

    Installation Failed

  5. Dion Hulse
    WordPress Dev
    Posted 3 years ago #

    Download failed.: Could not open handle for fopen() to http://wordpress.org/wordpress-3.1.zip

    You should only get that if you're using the streams or fopen transport, and since both should be disabled... Weird.

    But yes, The reason this has happened will be because byethost has changed or updated their php installation, and some functionalities are now not working correctly (despite PHP saying it should work)

  6. ezfira
    Member
    Posted 3 years ago #

    Hi Dion,

    I have the same problem and in addition, since the problem started showing my Dashboard is not loading all its widgets and some of the JavaScript (can't drag widgets...).

    When testing transport of cURL I get:
    An Error has occured: couldn't connect to host

    Trying to disable it has no effect.

    Thanks,
    Eyal

  7. Jan-Boike
    Member
    Posted 3 years ago #

    Hi *,

    Core control is a great plug-in that solved the issue for me!

    Read the instruction above and disable Transports that do not work!

    Perfect!

    Dion Hulse - thanks 1000x, keep up your work!

    JB

  8. viter-z-bayraku
    Member
    Posted 3 years ago #

    Dion Hulse, Thank You! :)

  9. angadsingh06
    Member
    Posted 3 years ago #

    Hi Dion,
    I really need your Help...
    I did all the Steps Above..

    PHP HTTP Extension	Not Available
    cURL	Available	Disable Transport | Test Transport	Primary GET
    Primary POST
    Primary GET(non-blocking)
    Primary POST(non-blocking)
    PHP Streams	Not Available
    PHP fopen()	Not Available
    PHP fsockopen()	Available	Disable Transport | Test Transport

    I tested both Available Transports
    the cUrl One says
    An Error has occured: Couldn't resolve host 'tools.dd32.id.au'
    and on retrying it says
    Successfully retrieved & verified document from http://tools.dd32.id.au/wordpress/core-control.php
    on testing the fsockopen
    it says
    An Error has occured: 0: php_network_getaddresses: getaddrinfo failed: No address associated with hostname
    and on re trying it says
    Successfully retrieved & verified document from http://tools.dd32.id.au/wordpress/core-control.php
    I have tried disabling both but the error is still there...
    Also I have disabled All plugins, and switched Themes running PHP5 and hosted on Yahoo webhost if that helps....
    Hope u have an answer....

  10. Dion Hulse
    WordPress Dev
    Posted 3 years ago #

    angadsingh06: What error is still there? If you run the test method, it'll ignore the disabled-ness of the transport and run it anyway.

    By looking at those responses, Your webhost has an issue with it's DNS, specifically, DNS lookups are timing out. The effect this is you'll have to try twice (at least probably) to allow it to connect when performing most actions.

    there is nothing which WordPress can do here, as it looks to be a issue within PHP which will affect every script on the server

    What's the actual problem you're coming up against within WordPress?

  11. angadsingh06
    Member
    Posted 3 years ago #

    I am stil getting the error An Unexpected HTTP Error occurred during the API request
    I also have another website with the same webhost and that is going good... If there is problem from the side of my webhost can u please tell me what to tell them is the problem so i can get it fixed.. THanks....

  12. mikeyfocus
    Member
    Posted 3 years ago #

    Hi Dion, great script!

    I am experiencing the same issues as discussed in this thread.
    The only transport method that works on my server is PHP Streams.

    When I ran the test, cURL returned An Error has occured: name lookup timed out. Others returned positively, but they didn't solve the HTTP Error issue apart fro, PHP Streams (which seems to be unreliable at times and still returns the occasional HTTP Error message)

    My server (VPS) hosts a lot of my client's websites which are WordPress installs. So this is a massive blow to me. I did not make any changes to the server configurations before this happened. I didn't change anything in PHP. It just suddenly stopped working out of the blue.

    So while we have this great work around, it just won't suffice. I need to kill the root of the problem, which is: Why did cURL suddenly start to fail server wide? Would be great if you could let me know what I should be looking at within my php config, or anything else for that matter.

    Thanks!

  13. Dion Hulse
    WordPress Dev
    Posted 3 years ago #

    mikeyfocus: Since you've got a VPS, it'll be a bit easier to track down "name lookup timed out" specifically refers to a DNS timeout issue, If you haven't changed anything, it could be that the DNS servers your VPS is set to use is now respondingly slowly - It might be worth timing it on the CLI or switching to a local root server (for testing purposes - try and use non-root servers, ie. relays for most access)

    Unfortunately, other than that I don't have enough knowledge of PHP's config to be able to say which directives to check/etc.

  14. valegk
    Member
    Posted 3 years ago #

    Hi, I'm having the same problem on my site.
    I've just installed WP and was about to change the layout theme but I get the "An Unexpected HTTP Error occurred during the API request. Try again" message. I can't event load the WP blog updates on the dashboard.
    I've installed Dion's plug-in, but I have no idea what should I do now:

    Transport Status Actions
    PHP HTTP Extension Not Available
    cURL Available Disable Transport | Test Transport Primary GET
    Primary POST
    Primary GET(non-blocking)
    Primary POST(non-blocking)
    PHP Streams Available Disable Transport | Test Transport
    PHP fopen() Available Disable Transport | Test Transport
    PHP fsockopen() Available Disable Transport | Test Transport

  15. Dion Hulse
    WordPress Dev
    Posted 3 years ago #

    but I have no idea what should I do now:

    Try disabling the cURL transport by clicking 'Disable Transport' on the cURL row, then give the action that was failing a try again.

    You shouldn't be getting that message if you're trying to change a theme layout however.. What was the page URL that you were trying to load when that happened?

  16. jimmywhitetrix
    Member
    Posted 3 years ago #

    Hi Dion,

    been making some progress with your plug-in, however I still cannot configure my External HTTP access.
    "RSS Error: WP HTTP Error: couldn't connect to host" or "WP HTTP Error: Could not open handle for fopen()" if I change from cURL to PHP Streams.

    PHP HTTP Extension Not Available
    cURL Available Disable Transport | Test Transport Primary GET
    Primary POST
    Primary GET(non-blocking)
    Primary POST(non-blocking)
    PHP Streams Available Disable Transport | Test Transport
    PHP fopen() Available Disable Transport | Test Transport
    PHP fsockopen() Available Disable Transport | Test Transport

    I need to configure HTTP Related Constants with the proxy settings. I am making the updates in web-config.php. When I refresh Core Control my settings appear but they are in orange. What does this Orange highlight mean? Are my proxy settings working?

    Constant Value
    WP_PROXY_HOST '10.43.15.3'
    WP_PROXY_PORT '3128'
    WP_PROXY_USERNAME '****'
    WP_PROXY_PASSWORD '****'

    --- thank you for any help

  17. Dion Hulse
    WordPress Dev
    Posted 3 years ago #

    hen I refresh Core Control my settings appear but they are in orange. What does this Orange highlight mean? Are my proxy settings working?

    Orange simply means non-default.

    It should be worth noting, that WordPress only supports HTTP proxies, not Socks proxies (which I believe 3128 = squid? is likely to be).

    You'll find some more documentation of setting up proxies in the code here: http://core.trac.wordpress.org/browser/trunk/wp-includes/class-http.php#L1184

    The proxy server may need to be modified to allow WordPress to pass through differently, which might not be possible in every environment I agree.

    If you end up in the position where you can't get external access to work at all, you may define 'WP_HTTP_BLOCK_EXTERNAL' to true to short-circuit external http requests to avoid timeout issues.

  18. jimmywhitetrix
    Member
    Posted 3 years ago #

    Thank you for your response & pointing me towards the documentation. I will try to apply the correct settings and let you know how I go.

    thanks again -

Topic Closed

This topic has been closed to new replies.

About this Topic