2012-06-19 77 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啓用。