duanhuan5409 2013-04-27 21:26
浏览 47
已采纳

HTTPS错误CodeIgniter Twitter REST API

How do I fix this HTTPS error?

I was trying to learn how to use Twitter's REST API with CodeIgniter when I encountered the following error

A PHP Error was encountered

Severity: Warning

Message: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?

Filename: controllers/search.php

Line Number: 36

A PHP Error was encountered

Severity: Warning

$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]: failed to open stream: No such file or directory

Filename: controllers/search.php

Line Number: 36

with the following code:

<?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 */
  • 写回答

1条回答 默认 最新

  • dsbx40787736 2013-04-27 21:41
    关注

    You will also need to make sure that php_openssl, .dll or .so based on your OS is enabled..

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 outlook无法配置成功
  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换