【问题标题】:How to fix error with OpenSSL protocol Composer?如何修复 OpenSSL 协议 Composer 的错误?
【发布时间】:2017-09-28 22:54:44
【问题描述】:

我尝试像这样安装作曲家:

curl -sS https://getcomposer.org/installer | php

它返回一个错误:

The openssl extension is missing, which means that secure HTTPS transfers are impossible. If possible you should enable it or recompile php with --with-openssl 尽管在 PHP 中启用了扩展 OpenSSL。

我可以在phpinfo()看到:

PHP Version 5.6.30

OpenSSL support enabled
OpenSSL Library Version LibreSSL 2.2.7
OpenSSL Header Version  LibreSSL 2.2.7
Openssl default config  /private/etc/ssl/openssl.cnf

如何解决这个问题?

【问题讨论】:

    标签: php macos ssl composer-php macos-sierra


    【解决方案1】:

    您可以通过添加 -k 来禁用 ssl 验证。

    curl -ksS https://getcomposer.org/installer | php
    

    【讨论】:

    • 同样的错误:Some settings on your machine make Composer unable to work properly. Make sure that you fix the issues listed below and run this script again: The openssl extension is missing, which means that secure HTTPS transfers are impossible. If possible you should enable it or recompile php with --with-openssl
    • 您发布的是哪个 phpinfo?命令行?每分钟? mod_php?必须在 cli 中启用 Openssl。
    • 您能解释一下如何使用 cli 启用吗?
    • 我使用 MAMP Web 服务器,Mac OS Sierra
    • 如果你从 mac 控制台/shell 运行这段代码,这意味着 php cli 执行它。你也可以在控制台中运行它并分享输出php -r "phpinfo();" | grep "openssl"
    猜你喜欢
    • 1970-01-01
    • 2015-02-24
    • 2019-06-25
    • 1970-01-01
    • 2020-06-05
    • 1970-01-01
    • 2019-03-12
    • 2018-05-18
    • 1970-01-01
    相关资源
    最近更新 更多