cURL no longer working

Status
Not open for further replies.

belltown

Member
Messages
97
Reaction score
4
Points
8
My web site uses cURL to retrieve data (business & restaurant listings, maps, directions, etc.) from other online sources (Google, Bing, Yahoo and Yelp). Everything was working well until the last couple of weeks when requests using cURL to retrieve data from external sources have been hanging, no data returned, no error code, just hanging. The same code works on my local server and on a couple of other free hosts.

Here's an example of code that is no longer working:

Code:
<?php
    
function getURL ($url) {

    if (($c = curl_init ($url)) === false)
        echo "Curl_init error: ".curl_error ($c);
    if (curl_setopt ($c, CURLOPT_RETURNTRANSFER, true) === false)
        echo "Curl_setopt error: ".curl_error ($c);
    if (($data = curl_exec ($c)) === false)
        echo "Curl_exec error: ".curl_error ($c);
    else
        echo "$data";

}

// This hangs ...
getURL ("http:/www.bing.com");

// This hangs ...
getURL ("http://local.yahooapis.com/LocalSearchService/V3/localSearch?".
            "appid=<my app id>".
            "&query=starbucks&latitude=47.6062095&longitude=-122.3320708&output=xml");
            
// This hangs ...
getURL ("http://api.bing.net/xml.aspx?".
            "AppId=<my app id>".
            "&Version=2.2&Query=sushi&Latitude=47.60881&Longitude=-122.338804&Sources=phonebook");
            
// This hangs ...
getURL ("http://api.yelp.com/business_review_search?".
            "ywsid=<my app id>".
            "&term=sushi&lat=47.60881&long=-122.338804");
            
// This works ...
getURL ("http://www.google.com");

// This hangs ...
getURL ("http://www.mapquestapi.com/directions/v1/route?".
            "key=<my app id>".
            "&from=SEA&to=BFI&format=xml");

?>
It seems that the only web site I can access now is Google. Attempts to access all other web sites hang.
 

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
They have blocked outgoing port 80 and are only whitelisting IP's with broad appeal.
 

belltown

Member
Messages
97
Reaction score
4
Points
8
They have blocked outgoing port 80 and are only whitelisting IP's with broad appeal.

Was there an announcement made that X10Hosting would be removing this feature that has previously been available on the free hosting plan? If so, I apologize for not reading it. If not, then I just wasted 3 hours of my time debugging my code trying to track down what was causing my web site to not work any longer.
 
Status
Not open for further replies.
Top