Take the 2-minute tour ×

Possible Duplicate:
file_get_contents with https?
Problems getting XML content via https using SimpleXML and PHP

I have the URL:

Which loads a file like this one:

    <calendar accommodation_id="1234567">
        <day date="2012-08-09" vacancy="false" minimum_nights="7" arrival_day="true"/>
        <day date="2012-08-10" vacancy="false" minimum_nights="3" arrival_day="true"/>
        <day date="2012-08-11" vacancy="false" minimum_nights="3" arrival_day="true"/>
        <day date="2014-01-31" vacancy="true" minimum_nights="3" arrival_day="true"/>

For some reason my script won't let me get the contents of this file. I'm using the same script as i have been with other URLs but this will always fail.

My script is:

$accom2 = file_get_contents();


Is there something I need to do for this type of URL?

share|improve this question
What error are you seeing? –  bcmcfc Aug 9 '12 at 14:02
According to this page, you need openssl enabled. Do you have it enabled? (And please don't repeat a question, move back to your older one) –  Alvin Wong Aug 9 '12 at 14:13
Please do not duplicate questions. Instead, edit your previous one. –  hakre Aug 9 '12 at 16:04
add comment

marked as duplicate by hakre, PeeHaa, Yan Berk, j0k, kapa Aug 10 '12 at 8:39


2 Answers

up vote 4 down vote accepted

probably an answer here: (if protocol is the issue)

file_get_contents with https?

share|improve this answer
Yes it was the extension=php_openssl.dll that needed to be activated in my php.ini thanks!! –  user1482082 Aug 9 '12 at 14:14
This is more a comment than an answer. Just saying, it's not your fault that OP is rather unspecific. –  hakre Aug 9 '12 at 16:07
Duplicates should not be posted as answer. You have comments and flags for that. –  kapa Aug 10 '12 at 8:40
i wasn't aware of it... I can't delete and make only a comment as it's an accepted answer. –  N4553R Aug 10 '12 at 8:45
add comment

Have you tried simplexml_load_file, I tested it's working for me

$xml = simplexml_load_file('https://www.casapilot.com/api/1/accommodations/calendar.xml?auth_token=hyXHjP8QdrRuX8q3FsbC&id[]=1049165');

share|improve this answer
But presumably file_get_contents() would also work for you? –  w3d Aug 9 '12 at 16:44
add comment
