我正在尝试在WAMP环境中安装Laravel,但出现了一个警告信息,提示openssl未启用,而我已经在WAMP中启用了它。
以下是消息的截图。
我正在尝试在WAMP环境中安装Laravel,但出现了一个警告信息,提示openssl未启用,而我已经在WAMP中启用了它。
以下是消息的截图。
可能 WAMP 和 Composer 使用不同的 PHP 安装。Composer 将使用在 PATH
环境变量中设置的 PHP。
如果您想启用 openssl 扩展来安装 Composer,首先需要检查 PHP 安装的位置。
echo %PATH%
,然后检查您的 PHP 安装位置。php.ini
的文件。extension=php_openssl.dll
行,删除开头的分号。现在可以安装 Composer 了。
echo %PATH%
后,输出的结果是:C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Sysem32\WindowsPowerShell\v1.0\;C:\Program files\Microsoft\Web Platform Installer\;C:\Program Files\MySQL\MySQL Server 5.5\bin
。在这些目录中都没有安装任何PHP,请问该怎么办? - abboodphp.ini
中取消注释extension_dir = "ext"
这一行。 - David Harkness我遇到了同样的问题,这是我找到的解决方案,在您的php.ini文件中需要做一些更改:
extension_dir = "ext"
extension = php_openssl.dll
这里的每个人都在讨论openssl扩展,但在Windows中,您也需要激活扩展目录。
extension_dir
的人,你太棒了! - giannis christofakislibeay32.dll
或liblibcrypto-*.dll
文件位于哪个路径?http://php.net/manual/de/openssl.installation.php - Bernhard Döblerc:\wamp\bin\apache\Apache2.4.4\bin\php.ini
但是Composer是使用CLI的PHP,因此它正在读取这个文件:
c:\wamp\bin\php\php5.4.12\php.ini (so you need to enable openssl there)
对于Composer,您将需要在扩展中启用该组件
c:\wamp\bin\php\php5.4.12\php.ini
变更:
;extension=php_openssl.dll
到
extension=php_openssl.dll
C:\php
. Composer's installer found it there without any additional promptingphp.ini
by default. Instead, you'll see two files, as noted below. Rename one to php.ini
or copy it into php.ini
.
Open your php.ini
file and remove the semicolon from this line (you might want to uncomment other things as well but this line is the only one necessary for Composer)
;extension=php_openssl.dll
这应该是您需要做的全部。Composer安装程序应该会完成您从这里需要的所有其他操作。
这是一个老问题,但我刚刚遇到了相同的问题(使用 PHP7),最终解决方案非常简单。根据其他答案取消注释php.ini
中的行并不够。我需要将其更改为:
;extension=php_openssl.dll
to:extension=ext/php_openssl.dll
注意ext
前缀。该dll文件已经存在,但是它在一个子文件夹中。更改配置后,Composer安装程序顺利完成。
您需要在两个文件(php和apache)中启用“ extension=php_openssl.dll”。 我的电脑文件路径如下:
您需要在服务器上启用 OpenSSL 扩展。
C:\wamp\bin\php\php5.4.12\php.ini
there is a semi-colon before the openssl extension
;extension=php_openssl.dll
remove the semi-colon and you'll have
extension=php_openssl.dll
有两个php.ini
文件,一个用于开发,另一个用于生产。不要动它们,还有一个带有齿轮图标可编辑的php.ini
文件,其中包含配置设置。
php.ini
,然后进行其他人在此处建议的编辑即可。 - Brynn Bateman添加一个系统变量:OPENSSL_CONF
OPENSSL_CONF的值应该是您当前PHP版本的openssl.cnf文件。
对于我来说,它是:
-> 重新启动WAMP -> 现在应该可以工作了
%PATH%
中PHP的路径,或许Composer正在寻找其他位置的PHP而非WampServer。 - Rubens Mariuzzo