title: HTTPS error CodeIgniter Twitter REST API
body: <p>How do I fix this HTTPS error?</p>
  
  <p>I was trying to learn how to use <a href="https://dev.twitter.com/docs/api/1.1" rel="nofollow">Twitter's REST API</a> with CodeIgniter when I encountered the following error</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Warning</p>
    
    <p>Message: file_get_contents() [function.file-get-contents]: Unable to
    find the wrapper "https" - did you forget to enable it when you
    configured PHP?</p>
    
    <p>Filename: controllers/search.php</p>
    
    <p>Line Number: 36</p>
    
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Warning</p>
  </blockquote>
  
  <pre><code>$a = json_decode(file_get_contents('https://api.twitter.com/1.1/statuses/mentions_timeline.json?@stackexchange'), true);
          var_dump($a);
  </code></pre>
  
  <blockquote>
    <p>[function.file-get-contents]: failed to open stream: No such file or
    directory</p>
    
    <p>Filename: controllers/search.php</p>
    
    <p>Line Number: 36</p>
  </blockquote>
  
  <p>with the following code:</p>
  
  <pre><code>&lt;?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-&gt;load-&gt;view('search_page');
      }
  }
  
  /* End of file search.php */
  /* Location: ./application/controllers/search.php */
  </code></pre>