WordPress.org

Ready to get started?Download WordPress

Forums

Unexpected http error _and_ Could not open handle for fopen() (7 posts)

  1. Sagittar
    Member
    Posted 3 years ago #

    Hello everyone

    I have a new installation of WP 3.0.3 on a local server running Arch Linux. When trying to install themes or plugins, I get An Unexpected HTTP Error occured during the API request.
    The more detailed error message is
    WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => Could not open handle for fopen() to http://api.wordpress.org/themes/info/1.0/ ) ) [error_data] => Array ( ) )
    I have googled and searched this forum, and accordingly I have changed the timeout in wp-includes/class-http.php to 30, and also ensured that fopen is enabled in my php.ini. I reverted to the twenty-ten theme, and ensured all plugins were disabled. To no avail: the problem continues, and no other solutions seem to have been posted.

    Manually installing the core-control plugin shows me that PHP HTTP extension and cURL are not available.For PHP Streams and also PHP fopen I get
    An Error has occured: Could not open handle for fopen() to http://tools.dd32.id.au/wordpress/core-control.php
    For PHP fsockopen() I get:
    An Error has occured: 0: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
    The server is able to ping WAN urls, to wget files and to open web pages in the CLI browser Links.

    I have now reached the limit of my troubleshooting ability, and I would really appreciate any help to resolve this.

  2. ClaytonJames
    Member
    Posted 3 years ago #

    Could there be something in the SELinux security context that is preventing scripts from executing/connecting to/from the network (via httpd)?

  3. Sagittar
    Member
    Posted 3 years ago #

    Thanks for your reply. Yes, of course, now you mention it, that's probable. I'd just been assuming it was something to do with the WordPress installation, instead of considering other aspects of the system.

    I've not had much chance to check as yet, other than to disable mod_security, which doesn't seem to make a difference. Any pointers as to what else I should be looking for?

  4. ClaytonJames
    Member
    Posted 3 years ago #

    I grabbed an excerpt from an selinux online man page reference.

    "httpd scripts by default are not allowed to connect out to the network...
    ...If you need scripts to be able to connect you can set the httpd_can_network_connect boolean on.

    setsebool -P httpd_can_network_connect 1"

    Might not be the issue, but it's worth checking into.

  5. Sagittar
    Member
    Posted 3 years ago #

    I began to get a nagging suspicion that maybe I was understanding something different from you by the term selinux, and I was right, SElinux turns out not to be part of the standard Arch Linux distribution. Thank you for the suggestion, though.

    I wonder what else I might not be considering.

  6. ClaytonJames
    Member
    Posted 3 years ago #

    Seems to be some similar discussions here,

    http://wordpress.org/support/topic/plugins-update-failure?replies=14

    http://wordpress.org/search/%22An+Unexpected+HTTP+Error+occured+during+the+API+request%22?forums=1

    ...but I'm afraid putting a finger on how to solve it might be over my head. My apologies for leading you down the wrong path on this one.

  7. Sagittar
    Member
    Posted 3 years ago #

    No need to apologise, I'm grateful you took the time to think about my problem.

    As a general observation, now that mod_security is disabled, I no lionger get the error messages at the plug-ins screen, although the feeds are somewhat garbled. They remain at the Themes selection screen.

Topic Closed

This topic has been closed to new replies.

About this Topic