0
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.

Perry
  • 11,172
  • 2
  • 27
  • 37
Vivek
  • 11
  • 1
  • 3
  • "It does not work", is not an error. Instead, tell us what you are getting? error? white page... – samayo Jul 13 '13 at 17:25
  • White page is displayed. – Vivek Jul 13 '13 at 17:31
  • How about another link? like [StackOverflow](http://stackoverflow.com) ? – samayo Jul 13 '13 at 17:32
  • if the URL is http, file get contents will be working. if it is https, file get contents will not be working.(only on windows) – Vivek Jul 13 '13 at 17:35
  • You should make sure https is a registered stream with `phpinfo`. – EPB Jul 13 '13 at 17:42
  • These are the errors showing, while parsing "file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? Message: file_get_contents(https://api.groupon.com/v2/deals.xml?division_id=houston&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8) [function.file-get-contents]: failed to open stream: No such file or directory " – Vivek Jul 13 '13 at 17:50
  • Hi EPB, is it possible? How can i get there? – Vivek Jul 13 '13 at 17:52
  • Add (or uncomment) extension=php_openssl.dll in php.ini EDIT: and you may need to reboot your HTTP server. – EPB Jul 13 '13 at 17:56

1 Answers1

1

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');
tlogbon
  • 1,212
  • 13
  • 12
  • These are the errors showing, while parsing "file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? Message: file_get_contents(https://api.groupon.com/v2/deals.xml?division_id=houston&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8) [function.file-get-contents]: failed to open stream: No such file or directory " – Vivek Jul 13 '13 at 17:49