laravel 安装 Composer OpenSSL 问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25240757/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 09:55:48  来源:igfitidea点击:

Installing Composer OpenSSL Issue

phplaravelopensslcomposer-php

提问by Javacadabra

Hi guys I am trying to install composerhowever when I go to install it I get this 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:

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

I currently have php 5.4.31and I am running WAMP2.2I've checked my php.inifile in the bin/php/php5.4.31/and ensured that the following line is uncommented:

我目前已经php 5.4.31并且正在运行WAMP2.2我已经检查了我的php.ini文件bin/php/php5.4.31/并确保以下行未注释:

extension=php_openssl.dll

The error still resolves and I'm at a loss as to how I can fix it. As I thought by uncommenting the line it would be enabled.

错误仍然解决,我不知道如何修复它。正如我认为通过取消注释该行它将被启用。

Also when I run this command in the terminal window php --iniI get the following message:

此外,当我在终端窗口中运行此命令时,php --ini我收到以下消息:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found

回答by DaveM

Make sure to uncomment this line in your php.ini file:

确保在 php.ini 文件中取消注释这一行:

 extension_dir = "ext"

It makes sure that PHP is taking the extension from its own ext library.

它确保 PHP 从它自己的 ext 库中获取扩展。

回答by Arjun Vs

@Javacadabra, extensions like php_openssl.dll will be under php/ext/ directory, you could fix this path in the config file or you could copy that specific file from php/ext directory to php directory.

@Javacadabra,php_openssl.dll 等扩展名将在 php/ext/ 目录下,您可以在配置文件中修复此路径,或者您可以将该特定文件从 php/ext 目录复制到 php 目录。

in your case it will be c:\php\ext

在你的情况下,它将是 c:\php\ext