救助, Mac 系统下 composer 报错 Protocol "https" not supported or disabled in libcurl - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
tg11
V2EX    PHP

救助, Mac 系统下 composer 报错 Protocol "https" not supported or disabled in libcurl

  •  
  •   tg11 Apr 6, 2021 3217 views
    This topic created in 1850 days ago, the information mentioned may be changed or developed.

    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 
    6 replies    2021-04-17 18:20:22 +08:00
    limingxinleo
        1
    limingxinleo  
       Apr 6, 2021
    php --ri openssl
    tg11
        2
    tg11  
    OP
       Apr 6, 2021
    @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
    ben1024
        3
    ben1024  
       Apr 6, 2021
    重装下 curl 试试
    echodone
        4
    echodone  
       Apr 13, 2021
    /Applications/MxSrvs/bin/composer/bin/composer.phar require xxx
    echodone
        5
    echodone  
       Apr 13, 2021
    试试这样行不行
    liuxu
        6
    liuxu  
       Apr 17, 2021
    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 做开发屁事多
    About     Help     Advertise     Blog     API     FAQ     Solana     2877 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 34ms UTC 10:52 PVG 18:52 LAX 03:52 JFK 06:52
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86