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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?