macos composer update报错 ..... Pr
2022-04-05 本文已影响0人
meteor_shower
1、php项目composer update报错
![](https://img.haomeiwen.com/i14215354/695962bd49bdf09a.png)
2、curl -V检查
![](https://img.haomeiwen.com/i14215354/1909af6e27e6ff76.png)
发现curl已经支持了https了
3、php版本检查
![](https://img.haomeiwen.com/i14215354/4d1e22c6f4bb584a.png)
4、php插件检查
![](https://img.haomeiwen.com/i14215354/a8aa4166fc5e8e26.png)
插件也已经含有openssl组件了
5、phpinfo检查 curl是否开启ssl
![](https://img.haomeiwen.com/i14215354/c93b11d7163ab361.png)
定位到问题所在,php7.4的 curl扩展不支持 https 需要重装 php7.4的curl扩展
6、curl下载
下载curl:https://curl.se/download.html
我下载的是当前最新的 curl-7.82.0版本
7、卸载mac自带curl
brew uninstall curl
8、编译安装curl
./configure --with-php-config=/Applications/MxSrvs/bin/php/bin/php-config --with-openssl=/usr/local/opt/openssl
备注:
–with-php-config=/Applications/MxSrvs/bin/php/bin/php-config 为php安装
--with-openssl=/usr/local/opt/openssl 指定openssl
下一步
make && make install
安装完成
9、查找集成环境 MxSrvs curl位置
![](https://img.haomeiwen.com/i14215354/430f2d28e6ea3150.png)
将原来_curl下的bak下,把新的curl复制过来
mv 7.70.0/ 7.70.0_bak
cp -r /xxx/Downloads/curl-7.82.0 7.82.0/
10、通过MxSrvs客户端界面重启php
打印phpinfo
![](https://img.haomeiwen.com/i14215354/1480723b08320ae8.png)
11、执行composer update
终于ok了