Search code examples
phplinuxwindowsfile-get-contentsgroupon

File_get_contents function does not work with windows?


file_get_contents("https://api.groupon.com/v2/deals.xml?division_id=cleveland&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8");

This code does not work on windows, but does with Linux. Because of https. Is there any solution.


Solution

  • It's possible you did not enable your url file open in your PHP configuration.

    See http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen for details on this configuration value.

    If this is not the cause, then you should specify what the exact error is, do this by adding the following to your code, before the file_get_contents function:

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');