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 扩展"错误
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
