file_get_content s()獲取https出現這個錯誤Unable to find the wrapper
解決辦法一,如果你是用的伺服器,可以參考這個辦法,修改php配置檔案(win主機),來支援https
在php.ini中找到並修改
extension=php_openssl.dll
allow_url_include = On
重啟服務就可以了,如果你的是linux伺服器,linux下的PHP,就必須安裝openssl模組,安裝好了以後就可以訪了。
解決辦法二,如果你用的不是伺服器,你用的主機,你沒法更改php的配置,你可以通過使用curl函式來替代file_get_contents函式,當然你的主機必須支援curl函式。
<?php
function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
echo getSslPage($_GET['url']);
相關文章
- ubuntu安裝軟體出現Unable to locate package錯誤解決UbuntuPackage
- 安裝ROS出現 Unable to Correct Problems ‘You have Held Broken Packages’ 錯誤ROSPackage
- java 讀取excel 檔案 Unable to recognize OLE stream 錯誤JavaExcel
- 記住這個錯誤PLS-00103: 出現符號符號
- php抓取https網址出現錯誤的解決方法PHPHTTP
- ios 如何獲取WKWebview錯誤資訊iOSWebView
- Flask擴充套件包安裝出現錯誤:Could not find a version that satisfies the requirement ...Flask套件UIREM
- GetDlgItem() 出現錯誤Git
- 安裝或執行clone報錯 Unable to find 'kshell' in path
- 高防上傳HTTPS證書出現“引數格式錯誤”報錯的解決辦法 – HTTPS SSL 教程HTTP
- 【錯誤】 Unable to compile class for JSPCompileJS
- Linux錯誤:xhost unable to open displayLinux
- springboot專案打包提示Unable to find a single main class from the following candidates錯誤Spring BootAI
- Opencv出現detecMultiScale錯誤OpenCV
- web前端小白經常出現“四”個錯誤Web前端
- php5.3.3呼叫https的wsdl,出現錯誤,請大家幫忙看看PHPHTTP
- 終端報錯"xcrun: error: unable to find utility “xcodebuild”, not a developer tool orErrorXCodeUIDeveloper
- 使用requests庫獲取這個URL
- Unable to create index.lock File exists錯誤Index
- Unable to locate package錯誤解決辦法Package
- Laravel 出現 419 錯誤Laravel
- AS打包出現app:transformClassesAndResourcesWithProguardForRelease錯誤APPORM
- 使用 sudo 命令出現錯誤
- FTP出現426錯誤FTP
- 這個錯誤,每個ScrumMaster都犯過ScrumAST
- tasklist 遠端獲取程式報錯賬號密碼錯誤密碼
- Unable to Find Sources for Current Linux KernelLinux
- Android:Unable to find explicit activity classAndroid
- ORA-7445(ACCESS_VIOLATION)(unable_to_trans_pc)(UNABLE_TO_WRITE)錯誤
- 錯誤捕獲
- NPM run dev 出現這樣錯誤我的解決辦法NPMdev
- 配置hive後設資料庫mysql時候出現 Unable to find the JDBC database jar on host : masterHive資料庫MySqlJDBCDatabaseJARAST
- 使用jstl時出現的一個錯誤,請指教!JS
- 錯誤 - Could not find the index entry for RIDIndex
- jQuery Validate獲取驗證錯誤的數目jQuery
- Flutter 最常出現的典型錯誤Flutter
- 配置nagios出現的錯誤iOS
- 執行Bex 出現 61704 錯誤