【问题标题】:HTTPS error CodeIgniter Twitter REST APIHTTPS 错误 CodeIgniter Twitter REST API
【发布时间】:2013-04-21 20:13:50
【问题描述】:

如何修复此 HTTPS 错误?

当我遇到以下错误时,我正在尝试学习如何将 Twitter's REST API 与 CodeIgniter 一起使用

遇到了 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 */

【问题讨论】:

标签: php json codeigniter twitter


【解决方案1】:

您还需要确保已启用基于您的操作系统的php_openssl.dll or .so..

【讨论】:

    猜你喜欢
    • 2019-12-27
    • 1970-01-01
    • 2014-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-13
    相关资源
    最近更新 更多