An Unexpected HTTP Error occurred during the API request in wordpress

I get this error on my wordpress blog hosted on my server each time i search for plugins or try to upgrade wordpress and on the dashboard. I have tried changing the timeout from 5 to 30 in the http.php file in wp-includes. This did NOT help. My blog works perfectly fine. This problem is really annoying as I have to manuall copy plugins and themes and upgrades.

Related posts

Leave a Reply

5 comments

  1. I had this problem the other day. It was due to my server’s firewall settings not allowing outbound connections to port 80 (which is what the WordPress plugin install stuff uses)

    I just restarted the firewall and fail2ban (to be sure) and it started working.

    Is your web server behind a firewall?

  2. It seems that your host can’t see the WordPress server in order to query it for searches and updates. This will be because of some configuration of your host or its network, controlled by your hosting company.

    Raise a support request with your hosting company, telling them that your hosting machine has a problem connecting to api.wordpress.org (which is almost certainly the server you’re having trouble connecting to) and asking them to look into the problem.

    You may have more luck asking on ServerFault; this isn’t really a programming question.

  3. I had the same problem and it drove me mad!! The issue was actually in /etc/php5/apache2/php.ini and nothing to do with the time out problem everyone is going on about (for me at least) I was convinced it wasn’t a time out issue because I was presented with the problem immediately upon requesting the download, so here is the solution and I hope it helps others:

    sudo nano /etc/php5/apache2/php.ini

    change: allow_url_fopen = Off
    to: allow_url_fopen = On

    Then restart apache server: sudo /etc/init.d/apache2 restart

  4. What’s your PHP memory_limit? I recently ran into problems when enabling plugins as my limit was set to 24M, upping it to 64M solved all the problems.