我使用codeigniter框架,我在控制器中放了一个脚本来强制下载某个文件夹中的现有文本文件。 连接使用协议HTTPS.当我点击从服务器下载文本文件时,发生了错误,如下所示:
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 包装器。
如何继续解决这个问题?
感谢您的任何建议...
也许您无法访问https协议。
试试这个 如何让file_get_contents()使用HTTPS?
或使用卷发或插座
确保启用了php_openssl.dll
或php_openssl.so
。