composer create 的时候,报错
[Composer\Downloader\TransportException]
Protocol "https" not supported or disabled in libcurl
上网查了后说是没有 OpenSSL,但是我已经安装过 OpenSSL 了,curl -V 查看也有 https 支持.
curl 7.64.1 (x86_64-apple-darwin20.3.0) libcurl/7.64.1 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 librtmp/2.3
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
1
limingxinleo 2021-04-06 13:22:47 +08:00
php --ri openssl
|
2
tg11 OP @limingxinleo
``` openssl OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.1.1g 21 Apr 2020 OpenSSL Header Version => OpenSSL 1.1.1g 21 Apr 2020 Openssl default config => /Applications/MxSrvs/libs/_openssl/1.1.1g/ssl/openssl.cnf Directive => Local Value => Master Value openssl.cafile => no value => no value openssl.capath => no value => no value ``` 执行后显示这个。但是 composer 还是报 Protocol "https" not supported or disabled in libcurl |
3
ben1024 2021-04-06 14:38:59 +08:00
重装下 curl 试试
|
4
echodone 2021-04-13 11:15:18 +08:00
/Applications/MxSrvs/bin/composer/bin/composer.phar require xxx
|
5
echodone 2021-04-13 11:16:05 +08:00
试试这样行不行
|
6
liuxu 2021-04-17 18:20:22 +08:00
curl 说了不算,老夫不信还能有这么奇怪的问题
找到你 php 的 curl.so 模块,然后 ldd curl.so liuxu@liuxu-Inspiron-7559:~$ ldd /usr/lib/php/20190902/curl.so libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f9491b3d000) libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f94917cb000) 然后看看你的 libcurl.so.4 liuxu@liuxu-Inspiron-7559:~$ ldd /lib/x86_64-linux-gnu/libcurl.so.4 libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f300fde8000) 最后检查一下 php 的配置文件,php --ini 找到 php.ini liuxu@liuxu-Inspiron-7559:~$ php --ini Configuration File (php.ini) Path: /etc/php/7.4/cli Loaded Configuration File: /etc/php/7.4/cli/php.ini liuxu@liuxu-Inspiron-7559:~$ grep "disable_" /etc/php/7.4/cli/php.ini disable_functions = disable_classes = 再不行用 vagrant 装 ubuntu 吧,mac 做开发屁事多 |