-1

重複の可能性:
HTTPS ストリーム ラッパーを有効にする方法

API からコンテンツを取得するために単純な XML を使用しています。通常は問題ありませんが、現在は URL が HTTPS になっているため、機能していないようです。とにかくこのあたりはありますか?

XML の例 (URL):

<?xml version="1.0"?>
<calendars>
  <calendar accommodation_id="1049165">
    <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"/>
  </calendar>
</calendars>

コード例:

$xml2 = file_get_contents('');
$availability = new SimpleXMLElement($xml2);
4

1 に答える 1

0

You are using the XML API of the www.casapilot.com website.

The API is via HTTPS, one example URI is:

https://www.casapilot.com/api/1/accommodations/calendar.xml?auth_token=hyXHjP8QdrRuX8q3FsbC&id=1049165

For HTTPs to work, PHP needs the openssl extension. The information is given on the related Stream Wrapper Page:

Note: HTTPS is only supported when the openssl extension is enabled.

The openssl extension is then used for all HTTPS "files" transparently with the stream-wrapper for all URIs starting with https://.

See as well the duplicate question:

于 2012-08-09T16:10:56.520 に答える