我刚刚安装了php,我正在尝试下载Composer。
下载时收到的消息如下:
c:\>curl -sS https://getcomposer.org/installer | php
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_
l' - The specified module could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_opens
The specified module could not be found.
in Unknown on line 0
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script aga
The openssl extension is missing, which means that secure HTTPS transf
possible.
If possible you should enable it or recompile php with --with-openssl
我确保在php.ini中启用extension = php_openssl.dll并使用php --ini
我能够验证是否已加载正确的php.ini文件。
如果我使用curl -sS http://getcomposer.org/installer | php
,则会显示完全相同的消息。
有人可以指导我完成解决方案吗?
修改:
我认为这是一个设置错误的php.ini的错误。具体来说,我没有取消注释extension_dir = "ext"
。但是现在我遇到了其他问题。当我尝试安装Composer时,我得到:
Connection Error [ERR_CONNECTION]: Unable to connect to getcomposer.org
Request to https://getcomposer.org/installer failed with errors:
SSL: Handshake timed out. Failed to enable crypto. Failed to open stream: operation failed
这对我来说又是一个糟糕的设置吗?
答案 0 :(得分:0)
在正确配置php并使用php -r "readfile('https://getcomposer.org/installer');" | php
命令后,我终于能够正确安装它。
答案 1 :(得分:0)
我认为crypto
问题是由于您尝试通过https
- protocoll访问安装程序页面而引起的。因此curl
必须使用SSL
- 加密本身使用crypto
- 库。您也可以尝试使用http://
下载安装程序。
希望有所帮助