Support » Fixing WordPress » Unexpected http error _and_ Could not open handle for fopen()

  • 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 ) ) [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
    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Could there be something in the SELinux security context that is preventing scripts from executing/connecting to/from the network (via httpd)?

    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?

    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.

    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.

    Seems to be some similar discussions here,

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

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unexpected http error _and_ Could not open handle for fopen()’ is closed to new replies.