我正在尝试安装
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:
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 5.4.31
并且正在运行 WAMP2.2
我已经检查了 php.ini
中的 bin/php/php5.4.31/
文件并确保以下行未注释:
extension=php_openssl.dll
错误仍然解决,但我不知道如何修复它。正如我所想,通过取消注释该行,它将被启用。
此外,当我在终端窗口中运行此命令时
php --ini
我收到以下消息:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found
如果您是 Windows 用户,请确保在 php.ini 文件中取消注释此行:
extension_dir = "ext"
它确保 PHP 从它自己的 ext 库中获取扩展。
@Javacadabra,像 php_openssl.dll 这样的扩展将位于 php/ext/ 目录下,您可以在配置文件中修复此路径,或者可以将该特定文件从 php/ext 目录复制到 php 目录。
在你的情况下它将是 c:\php xt
针对面临相同问题的人的快速检查列表:
Before any step if you have any apache running with this PHP version, stop it.
;extension=openssl
并删除“;”从行首开始; https://php.net/extension-dir
;extension_dir = "./"
; On windows:
;extension_dir = "ext"