Groupon api doesn't work on server and work on WAMP


I am using groupon api for geting deals. Its work on wamp but when i upload the files on sever it doesn’t work on server my code is:

$apikey = “client_id=mykey”;
$division = “division_id=”. urlencode($city);
$url = ““.implode(”&”, array($apikey, $division));
$response2 = file_get_contents($url);

$deals = json_decode($response2, true);


Any body?

On your live server look closely at the output of phpinfo() and compare it with that from your wamp server.

You may well find that safe_mode is “on”, which will block file_get_contents() from going out, but something else could be blocking external fetches too, so look carefully.

If this is the problem, check if cURL is installed/working on your live server, if so you can use that instead.

After checking Cups recommendation, you may want to check the following:

I haven’t worked with the Groupon API, but a few APIs I have recently implemented required me to tie a domain to the API Key. You may want to check if that is the case with Groupon, if so, you may need a new API Key for your live Server or you may need to update your current API Key.

Thanks Cups and cpradio my problem is solved through curl.