【问题标题】:Composer install squizlabs/php_codesniffer PHP 7.4 on Windows 10 is failed to installComposer install squizlabs/php_codesniffer PHP 7.4 on Windows 10 安装失败
【发布时间】:2023-02-26 18:57:30
【问题描述】:

我在 Windows 10 和 PHP 7.4.4 上使用 Composer v. 1.10.20 安装 squizlabs/php_codesniffer 时出现以下错误:


[Composer\Exception\NoSslException]
  The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl ex
  tension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.

我该如何解决?如何在 Windows 10 上安装 openssl 扩展?

我尝试使用命令安装 squizlabs/php_codesniffer=* composer library: composer.bat global require "squizlabs/php_codesniffer=*" 但失败并出现上面的错误。 我希望通过安装和启用缺少的库或包来修复错误。

【问题讨论】:

    标签: php windows composer-php


    【解决方案1】:
    1. 导航到您的 php 文件夹并打开 php.ini 文件

    2. 去掉分号

      //before

      ;扩展名=openssl

      //after

      扩展名=openssl

    3. 保存存档

    4. 打开新终端并测试它现在应该可以工作

    【讨论】:

      猜你喜欢
      • 2019-08-11
      • 2013-02-02
      • 2014-09-28
      • 2019-05-20
      • 1970-01-01
      • 2021-12-02
      • 2021-08-10
      • 2021-07-29
      • 2019-10-06
      相关资源
      最近更新 更多