簡體   English   中英

stream_context_get_params()不是函數點火器

[英]stream_context_get_params() is not a function codeigniter

我正在使用'codeigniter-facebook-google-login'庫

致命錯誤:在第203行的/application/libraries/oauth2/Provider.php中調用未定義的函數stream_context_get_params()

代碼如下。

$opts = array('http' => array('method'  => 'POST', 'header'  => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params),));

$_default_opts = stream_context_get_params(stream_context_get_default());
$context = stream_context_create(array_merge_recursive($_default_opts['options'], $opts));

$response = file_get_contents($url, false, $context);

$return = json_decode($response, true);

我的php版本在服務器上是5.4.38,因為php文檔stream_context_get_params支持的版本大於5.3.0v

任何人都知道問題是什么或問題的替代方案...

我不知道圖書館,但錯誤很明顯。 檢查文件“ Provider.php”,並確保該函數在該文件中的某個地方聲明,或者需要一個缺少該函數的文件。 我確信該功能在您只需在“ Provider.php”中使其可用的某個位置可用,一切都會很好

編輯:根據您的評論,這是php 5.3的本機功能,因此,如果不可用,您必須運行舊版本的php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM