Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Tim W

    (@timwhitlock)

    unlikely to be a problem with the plugin. sounds like a network problem.

    can other scripts on your server access remote hosts?

    Thread Starter James Davies

    (@james-davies)

    yes, I have a facebook plugin working ok

    Plugin Author Tim W

    (@timwhitlock)

    can other scripts access https://api.twitter.com ?

    Thread Starter James Davies

    (@james-davies)

    Sorry Tim, I’m just an amateur trying to build myself a smallish hobby site. I wouldn’t know where to begin or how to find that out.

    Plugin Author Tim W

    (@timwhitlock)

    well it still sounds like a network problem. The plugin uses WordPress’s built-in HTTP methods, which in turn use PHP’s cURL library, which in turn uses the local OS it’s all running on.

    so the quickest way to find the problem is start at the bottom of that stack. Your computer/server – wherever the site is running.

    If you have Terminal/Command line access, try running:

    curl "https://api.twitter.com/1.1/" -i

    You should get a 400 Bad Request, which counts as connecting to the host. If that works on the same machine as your WordPress is running, then we’ll have to dig deeper.

    Plugin Author Tim W

    (@timwhitlock)

    closing this after two weeks with no follow up

    I have the same issue…
    The response of curl “https://api.twitter.com/1.1/” -i command is

    HTTP/1.1 400 Bad Request
    content-length: 24
    content-type: text/plain
    date: Wed, 09 Jul 2014 09:03:43 UTC
    server: tfe
    set-cookie: guest_id=v1%3A140489662379400000; Domain=.twitter.com; Path=/; Expires=Fri, 08-Jul-2016 09:03:43 UTC
    strict-transport-security: max-age=631138519
    
    Bad Authentication data

    Plugin Author Tim W

    (@timwhitlock)

    The response of your test is correct, it just shows you can “connect to the host”.

    Is there something I have to change on my server?

    The response is correct, but it doesn’t work, at all? I double checked keys, tokens and secrets. They are correct… I even have set the apps permissions to full access. But still
    0: Error -1, name lookup timed out

    This time it is name lookup time out

    Plugin Author Tim W

    (@timwhitlock)

    yes the response is correct for the purpose of the test. This thread is someone reporting a “could not connect to host” problem, so the solution I gave was to see if they had network trouble – to which they didn’t reply. The test above is not supposed to give an authenticated response, because it doesn’t attempt to authenticate with any keys. Any response at all, with any error code at all means they CAN connect to the host in order for the host to give them an error.

    Your apparently intermittent problem – “name lookup time out” sounds like a network problem too and nothing to do with keys and secrets.

    I pinged for the twitter api from the server and it seems it takes a long time to respond.
    I don’t know if it could be a solution but… is it possible to alter the (the waiting for a) response time?

    Plugin Author Tim W

    (@timwhitlock)

    Plugin Author Tim W

    (@timwhitlock)

    see filter http_request_timeout

    This plugin uses WordPress’s HTTP transport.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘0: Error -1, couldn't connect to host’ is closed to new replies.