この HTTPS エラーを修正するにはどうすればよいですか?
次のエラーが発生したときに、CodeIgniterで Twitter の REST APIを使用する方法を学ぼうとしていました。
PHP エラーが発生しました
重大度: 警告
メッセージ: file_get_contents() [function.file-get-contents]: ラッパー "https" が見つかりません - PHP を構成したときに有効にするのを忘れましたか?
ファイル名: controllers/search.php
ライン番号: 36
PHP エラーが発生しました
重大度: 警告
$a = json_decode(file_get_contents('https://api.twitter.com/1.1/statuses/mentions_timeline.json?@stackexchange'), true);
var_dump($a);
[function.file-get-contents]: ストリームを開けませんでした: そのようなファイルまたはディレクトリはありません
ファイル名: controllers/search.php
ライン番号: 36
次のコードを使用します。
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Search extends CI_Controller {
public function index()
{
$a = json_decode(file_get_contents('https://api.twitter.com/1.1/statuses/mentions_timeline.json?@stackexchange'), true);
var_dump($a);
//$this->load->view('search_page');
}
}
/* End of file search.php */
/* Location: ./application/controllers/search.php */