Support » Fixing WordPress » An Unexpected HTTP Error occured during the API request (a new variant)

  • Hello,

    I just installed WordPress 3.0.1 on my server:
    Ubuntu Server 10.04
    Apache 2.2.14
    PHP 5.3.2-1ubuntu4.2
    MySQL 5.1.41-3ubuntu12.6

    The first thing I did was try to install a theme. I get an error message:

    “An Unexpected HTTP Error occured during the API request”

    I turned on debugging in wp-config.php and it gave me this output:

    “Notice: Undefined property: WP_Error::$themes in /wordpress/wp-admin/includes/theme-install.php on line 272 Notice: Undefined property: WP_Error::$info in /wordpress/wp-admin/includes/theme-install.php on line 272 Notice: Undefined property: WP_Error::$info in /wordpress/wp-admin/includes/theme-install.php on line 272”

    I could probably do a bad hack to let this slide somehow but I’m not really keen on that. I have read a few of the threads on the “unexpected HTTP error” and often the blame gets put on the server, but from what I’ve read I haven’t figured out exactly what about the server that would be misconfigured. I’ll take any help you can give me here, fine people. 🙂


Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Most likely is that your server isn’t able to directly download the theme from This could be overzealous security settings, or lots of other possibilities. There’s simply too many different ways to cause this sort of problem. WordPress expects some minimal basics, and being able to have the server contact the outside world is one of those.

    Try downloading the theme ZIP file manually, then uploading it to your site. On the theme installer, there’s an option to upload a zip file of a theme directly.

    Thanks for the reply.

    The info that I need would be what means the WordPress software uses to communicate with the theme servers. I want to look into what causes the problem.

    (I am not looking for a quick fix to get the site up and running. This is like my test run of this software to see if I’m gonna use it later on so I want to try to get it running the way it was intended.)

    I must add that browsing the “Install Plugins” pages works. It seems strange to me that one of them does and one of them doesn’t as I’d assume they’d use the same means to contact the servers.

    I also get this error on the “Install Themes” search page, without having done a search:

    “Notice: Undefined variable: features in /wordpress/wp-admin/includes/theme-install.php on line 84”

    Ok, I’ve checked a bunch of the code now and I think this:

    “Notice: Undefined variable: features in /wordpress/wp-admin/includes/theme-install.php on line 84”

    is a bug. (Or laziness.)

    I might be wrong of course as I haven’t looked a lot at it, but I’ve grepped all the $features in the source and looked at the functions where they are contained (and some of the functions the functions are calling) and this code:

    function install_themes_feature_list( ) {
    	if ( !$cache = get_transient( 'wporg_theme_feature_list' ) )
    		set_transient( 'wporg_theme_feature_list', array( ),  10800);
    	if ( $cache  )
    		return $cache;
    	$feature_list = themes_api( 'feature_list', array( ) );
    	if ( is_wp_error( $feature_list ) )
    		return $features;
    	set_transient( 'wporg_theme_feature_list', $feature_list, 10800 );
    	return $feature_list;

    returns a variable that hasn’t been set.

    Anyway, I don’t have any more time to check through the code as I’m not familiar with it and this wasn’t really how I was gonna spend my evening. 😉

    I don’t know if the two errors are related though.

    Confusing use of global in the code too.


    i just installed wordpress and am getting the EXACT same errors as you have described. To the letter.

    Have you found the problem?

    I am ready to give up on this.

    my info:
    hosted at: 000webhost

    the errors show up on the wordpress admin area when i try to go into themes.

    help:) thanks!

    hello, i have the same problem as the user:
    i have the same host, i think is a host problem, i noticed that even they have the script installer down (you can’t install wordpress using the cPanel script installer) my only advice (and i don’t want to sound mean) is to change your host, if you got a .com domain you probably have a possibility to get a paid host.
    PS: im searching for an fix for this for few days now and i still cannot find anything.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘An Unexpected HTTP Error occured during the API request (a new variant)’ is closed to new replies.