#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0

    Arrow CURL cannot connect from web server, only from local machine


    I don't know if this is the right forum for this, so sorry if it's not. Also, I've replaced the urls with "url blocked" since I can't post the example ones.

    Using

    PHP Code:
    $curl_handle curl_init();
    curl_setopt$curl_handleCURLOPT_CONNECTTIMEOUT10 );
    curl_setopt$curl_handleCURLOPT_RETURNTRANSFER);
    curl_setopt$curl_handleCURLOPT_HEADER);
    curl_setopt$curl_handleCURLOPT_VERBOSE);
    curl_setopt$curl_handleCURLOPT_URL"url blocked" );
    $buffer curl_exec$curl_handle );
    print_rcurl_getinfo $curl_handle ) ); 
    I get

    PHP Code:
    Array ( [url] => url blocked [content_type] => [http_code] => 
    [header_size] => [request_size] => [filetime] => -[ssl_verify_result] => 0
    [redirect_count] => [total_time] => 10.00005 [namelookup_time] => 0.001271 
    [connect_time] => [pretransfer_time] => [size_upload] => [size_download] => 
    [speed_download] => [speed_upload] => [download_content_length] => -
    [upload_content_length] => -[starttransfer_time] => [redirect_time] => 
    So it seems not to be connecting to the server, yet the identical code works fine from my local machine. Is there any way to get more information? My suspicion is that either my webhost is blocking the outgoing connection or the server I'm trying to connect to is refusing the connection (at one stage a few months back they were doing this but I was at least receiving 403 messages, now I'm getting nothing). I've tried increasing the timeout but same result (with 10 replaced by the timeout in the response). Also, the namelookup_time seems very small, so I wonder if that is failing somehow? The namelookup_time is much smaller than when I connect to google, which works without any problems from the webserver. I've also tried connecting via proxies, with the same results as above.
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,992
    Rep Power
    9397
    Totally the right place.

    Outbound blocking is less likely than the remote host blocking the inbound connection (especially if you say they were doing this a while back).
    Can you SSH to the machine? From the command line try a wget/curl to that URL and see what happens. It'll probably fail the same way: unable to connect after some amount of time.

    Sounds like you can talk to those people. Ask them if you're blocked.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0
    I can't use the command line since I'm using shared server hosting and don't have access. I'd also prefer to avoid asking the other server operators if they're blocking me if possible.

    Just to confirm though, the results with the proxies and the namelookup_time, are they red herrings? I don't have a lot of experience with these sorts of things.

    Are there any other tests I could run to confirm what's happening?
  6. #4
  7. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,992
    Rep Power
    9397
    The remote host may be whitelisting addresses for who can talk to it - if so then proxies wouldn't make any difference (because they're not on the list either). As for namelookup_time, based on the name I'm going to assume that's DNS lookup so that should always be very small.

    There's not a whole lot you can do if you can't get a terminal on the problem computer and you can't get more information from the host.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0
    ok, thanks. I'm pretty sure it's not a whitelist since the site is public and receives tens of millions of different connections every week. I guess I'll keep looking/praying.
  10. #6
  11. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,992
    Rep Power
    9397
    Originally Posted by GGaryG
    I'm pretty sure it's not a whitelist since the site is public and receives tens of millions of different connections every week.
    ...So what did you mean by
    Originally Posted by GGaryG
    or the server I'm trying to connect to is refusing the connection (at one stage a few months back they were doing this but I was at least receiving 403 messages, now I'm getting nothing)
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0
    I'm not sure what you're asking but the millions of connections to the server are not from me because my server is no longer able to connect. The bit you quoted is referring to my circumstances, not anyone else's.

    I'm just saying a whitelist seems unlikely since it would be one hell of a long whitelist to maintain.

IMN logo majestic logo threadwatch logo seochat tools logo