php获取远程https内容时提示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
异常原因
这个异常是因为当前的php没有配置openssl模块, 所以在php访问https的内容时就提示 Unable to find the wrapper "https" 异常。
解决方法: 安装 openssl扩展
在macos中通过macport安装php后,默认是没有安装openssl扩展的, 需要我们手动安装一下这个openssl的扩展。
# 首先确定当前php版本 php -version # 然后安装 openssl扩展 , 这里以php7.2版本为例 sudo port install php72-openssl
如果你的php非port安装的,解决方法也是一样的,安装对应php的 openssl 扩展即可。
通过port search查找可用的php openssl扩展包参考
命令: port search --name --line --regex '^php(d+)-openssl'

以上就是php获取远程https内容时提示PHP Warning: copy(): Unable to find the wrapper "https" 解决方法的详细内容,更多关于php获取https提示Unable to find的资料请关注科站长其它相关文章!
栏 目:PHP编程
本文标题:php获取远程https内容时提示PHP Warning: copy(): Unable to find the wrapper “https“ 解决方法
本文地址:https://fushidao.cc/wangluobiancheng/3365.html
您可能感兴趣的文章
- 05-12php编程基础期末考试重点是什么,php编程基础
- 05-12PHP是前端还是后端语言?PHP前端编程语言常被误解为纯后端
- 05-12{php 5 高级编程}怎么样,php5高级编程教程
- 05-12php编程windows环境怎么配置?PHP Windows环境配置教程
- 05-12php编程无限保存,php如何实现无限级数据保存
- 05-12php编程宝典dvd哪里下载,php编程宝典
- 05-12php编程能力提升难吗,php编程能力提升
- 05-12php需要怎么编程,php编程入门教程
- 05-12如何高效学习PHP编程?PHP实战技巧有哪些
- 05-12php编程的软件有哪些,php编程软件推荐
阅读排行
推荐教程
- 07-25PHP建立MySQL与MySQLi持久化连接(长连接)区别
- 07-25PHP WindSearch实现站内搜索功能
- 07-25PHP调用FFmpeg实现视频切片
- 02-01PHP编程用什么软件?资深开发者为你揭秘最佳工具组合
- 01-23重庆哪里能找到专业的PHP编程培训班?推荐哪家比较好?
- 01-23如何通过PHP编程实现从文本框输入并处理整数的完整代码示例?
- 02-22PHP编程架构原理,如何深入理解其应用与实际开发中的应用场景?
- 01-28php编程第3版pdf中,有哪些新特性或更新让我不得不重新学习?
- 01-21PHP编程如何巧妙实现九九乘法表?分享编程技巧与代码细节!
- 11-23PHP 7安装使用体验之性能大提升,兼容性强,扩展支
