php獲取遠(yuǎn)程https內(nèi)容時(shí)提示PHP Warning: copy(): Unable to find the wrapper “https“ 解決方法
異常信息:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
PHP Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. copy($source_file = 'https://getcomposer.org/installer', $destination_file = 'composer-setup.php') Command line code:1
Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
Call Stack:
0.0001 388024 1. {main}() Command line code:0
0.0008 388024 2. copy($source_file = 'https://getcomposer.org/installer', $destination_file = 'composer-setup.php') Command line code:1
異常原因
這個(gè)異常是因?yàn)楫?dāng)前的php沒有配置openssl模塊, 所以在php訪問https的內(nèi)容時(shí)就提示 Unable to find the wrapper "https" 異常。
解決方法: 安裝 openssl擴(kuò)展
在macos中通過macport安裝php后,默認(rèn)是沒有安裝openssl擴(kuò)展的, 需要我們手動(dòng)安裝一下這個(gè)openssl的擴(kuò)展。
# 首先確定當(dāng)前php版本 php -version # 然后安裝 openssl擴(kuò)展 , 這里以php7.2版本為例 sudo port install php72-openssl
如果你的php非port安裝的,解決方法也是一樣的,安裝對(duì)應(yīng)php的 openssl 擴(kuò)展即可。
通過port search查找可用的php openssl擴(kuò)展包參考
命令: port search --name --line --regex '^php(\d+)-openssl'

以上就是php獲取遠(yuǎn)程https內(nèi)容時(shí)提示PHP Warning: copy(): Unable to find the wrapper “https“ 解決方法的詳細(xì)內(nèi)容,更多關(guān)于php獲取https提示Unable to find的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
PHP 批量更新網(wǎng)頁內(nèi)容實(shí)現(xiàn)代碼
lost63原創(chuàng)的,批量替換內(nèi)容的php代碼2010-01-01
PHP檢測(cè)數(shù)據(jù)類型的幾種方法(總結(jié))
下面小編就為大家?guī)硪黄狿HP檢測(cè)數(shù)據(jù)類型的幾種方法(總結(jié))。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-03-03
PHP實(shí)現(xiàn)的曲線統(tǒng)計(jì)圖表示例
這篇文章主要介紹了PHP實(shí)現(xiàn)的曲線統(tǒng)計(jì)圖表,結(jié)合實(shí)例形式分析了php基于圖形繪制實(shí)現(xiàn)曲線統(tǒng)計(jì)圖展現(xiàn)功能的相關(guān)操作技巧,需要的朋友可以參考下2016-11-11
php bootstrap實(shí)現(xiàn)簡(jiǎn)單登錄
這篇文章主要為大家詳細(xì)介紹了php bootstrap實(shí)現(xiàn)簡(jiǎn)單登錄的具體方法,感興趣的小伙伴們可以參考一下2016-03-03
一個(gè)基于PDO的數(shù)據(jù)庫操作類(新) 一個(gè)PDO事務(wù)實(shí)例
原先已經(jīng)寫過一個(gè)PDO的數(shù)據(jù)庫操作類,這次只是在原先基礎(chǔ)上進(jìn)行修改。2011-07-07
PHP+MySQL實(shí)現(xiàn)消息隊(duì)列的方法分析
這篇文章主要介紹了PHP+MySQL實(shí)現(xiàn)消息隊(duì)列的方法,結(jié)合實(shí)例形式分析了php+mysql構(gòu)建消息隊(duì)列并使用定時(shí)器間歇發(fā)送信息相關(guān)操作技巧,需要的朋友可以參考下2018-05-05
php 自定義函數(shù)實(shí)現(xiàn)將數(shù)據(jù) 以excel 表格形式導(dǎo)出示例
這篇文章主要介紹了php 自定義函數(shù)實(shí)現(xiàn)將數(shù)據(jù) 以excel 表格形式導(dǎo)出,結(jié)合實(shí)例形式分析了PHP操作二維數(shù)組的遍歷與Excel格式輸出相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-11-11
PHP+MySQL高并發(fā)加鎖事務(wù)處理問題解決方法
這篇文章主要介紹了PHP+MySQL高并發(fā)加鎖事務(wù)處理問題解決方法,結(jié)合實(shí)例形式分析了PHP+MySQL事務(wù)處理相關(guān)操作技巧與注意事項(xiàng),需要的朋友可以參考下2018-04-04
php 靜態(tài)屬性和靜態(tài)方法區(qū)別詳解
這篇文章主要介紹了php 靜態(tài)屬性和靜態(tài)方法區(qū)別詳解,需要的朋友可以參考下2017-04-04
PHP中foreach循環(huán)中使用引用要注意的地方
發(fā)現(xiàn)了一個(gè)容易出錯(cuò),但是不懂得原理卻解釋不明白的問題,碰到類似問題的朋友可以參考下。2011-01-01

