2012-06-19 74 views
0

我使用codeigniter框架,我在控制器中放置了一个脚本来强制下载某个文件夹中的现有文本文件。连接使用的协议HTTPS.when我点击下载从服务器的文本文件,已经发生了错误,它的下面:Codeigniter使用https协议的file_get_content()错误权限

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/process.php 

当我打印"var_dump(stream_get_wrappers());",让这样一个结果:

array(10) { 
    [0]=> 
    string(3) "php" 
    [1]=> 
    string(4) "file" 
    [2]=> 
    string(4) "glob" 
    [3]=> 
    string(4) "data" 
    [4]=> 
    string(4) "http" 
    [5]=> 
    string(3) "ftp" 
    [6]=> 
    string(13) "compress.zlib" 
    [7]=> 
    string(14) "compress.bzip2" 
    [8]=> 
    string(4) "phar" 
    [9]=> 
    string(3) "zip" 
} 

因此数组中不存在https封装器。

如何继续解决这个问题?

谢谢你的任何建议...

+2

本网站上的快速搜索引擎可以帮助您:http://stackoverflow.com/search?q=file_get_contents+with+https – Robert

+0

谢谢。我会检查这个。 –

回答

0

也许你没有访问https协议。

试试这个How to get file_get_contents() to work with HTTPS?

或者使用卷曲或插座

+0

谢谢。如何可以使用?使用https卷曲? –

+0

我检查它,我重新编辑下面的问题,你可以看到当我尝试使用时发生了什么:var_dump(stream_get_wrappers()); –

+0

谢谢你,https目前运行良好 –

0

确保php_openssl.dllphp_openssl.so启用。