我在 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 文件夹并打开 php.ini 文件
去掉分号
//before
;扩展名=openssl
//after
扩展名=openssl
保存存档
打开新终端并测试它现在应该可以工作