Install Composer fails with quot;The openssl extension is missingquot; error(安装 Composer 失败并显示“缺少 openssl 扩展错误)
问题描述
我正在尝试安装 Composer,但出现以下错误:
I'm attempting to install Composer but I get the following error:
您机器上的某些设置使 Composer 无法正常工作.确保您修复了下面列出的问题并再次运行此脚本:
"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:
缺少 openssl 扩展,这意味着无法进行安全的 HTTPS 传输.如果可能,您应该启用它或使用 --with-openssl" 重新编译 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.ini-production 并取消注释:"extension=php_openssl.dll"
I have then gone into my php.ini-production and uncommented: "extension=php_openssl.dll"
这仍然不起作用,我还有什么需要做的吗?
This still doesn't work though, is there something else I have to do?
推荐答案
我怀疑php.ini-production"是一个适合现场环境的虚拟配置文件.在控制台执行 php -i
并找到 'php.ini' 路径,以查看它期望保存 ini 文件的位置.这通常需要php.ini",并且可能实际上不存在 - 如果不存在,请将 php.ini-development(或类似的)复制到所需的位置.
I suspect "php.ini-production" is a dummy configuration file suitable for live environments. Do a php -i
at the console and find the 'php.ini' path, to see where it is expecting the ini file to be kept. This is normally expecting "php.ini", and may not actually exist - if it does not, copy php.ini-development (or similar) to the location required.
它位于(很长)输出的顶部附近,因此您可能会发现将其重定向到一个文件很有帮助(php -i > C:phpinfo.txt
).
This is near the top of (a very long) output, so you may find redirecting it to a file helpful (php -i > C:phpinfo.txt
).
这篇关于安装 Composer 失败并显示“缺少 openssl 扩展"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:安装 Composer 失败并显示“缺少 openssl 扩展"错误
基础教程推荐
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01