安装Windows版Composer-无法找到包装器"https" [英] Installing Composer for Windows - unable to find wrapper "https"
问题描述
我正在尝试使用命令行通过以下调用安装Composer for Windows:
I am trying to install Composer for Windows using the command line with the following call:
php -r"readfile( https://getcomposer.org/installer );" | php
php -r "readfile(https://getcomposer.org/installer);" | php
但是,我收到此错误消息:
However, I get this error message:
警告:readfile():无法找到包装器"https"-在配置PHP时您是否忘记启用它?在第1行的命令行代码中
Warning: readfile(): Unable to find the wrapper "https" - did you forget to enable it when configured PHP? in Command line code on line 1
调用堆栈: 0.0010 224336 1. {main}()命令行代码:0 0.0010 224488 2. readfile()命令行代码:1
Call Stack: 0.0010 224336 1. {main}() Command line code:0 0.0010 224488 2. readfile() command line code:1
警告:readfile( https://getcomposer.org/installer ):打开流失败:参数无效在第1行的命令行代码中
Warning: readfile(https://getcomposer.org/installer): failed to open stream: invalid argument in Command line code on line 1
调用堆栈: 0.0010 224336 1. {main}()命令行代码:0 0.0010 224488 2. readfile()命令行代码:1
Call Stack: 0.0010 224336 1. {main}() Command line code:0 0.0010 224488 2. readfile() Command line code:1
我已经取消对php5.5.12目录中的; extension = php_openssl.dll"行的注释,重新启动了浏览器,并尝试了其他变体.当我仅使用https中的's'运行命令时,我得到:
I have already uncommented the ";extension=php_openssl.dll" line in the php5.5.12 directory, restarted the browser, and tried other variants. When I run the command with just the 's' in https dropped, I get:
计算机上的某些设置使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
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
我曾尝试在多个地方添加--with-openssl标志,但似乎并没有解决问题.
I've tried including this --with-openssl flag at various places but it doesn't seem to be doing the trick.
推荐答案
这听起来好像您的安装尚未启用openssl.
This sounds like your installation hasn't got openssl enabled.
找到您的php.ini
文件(在Windows上,该文件可能与php.exe
(在我的计算机上为c:\php
)在同一位置.
Locate your php.ini
file (on Windows this is probably in the same place as the php.exe
(c:\php
on my machine).
在您喜欢的编辑器中打开它,然后找到行
Open it in your favourite editor, and locate the line
;extension=php_openssl.dll
删除分号
extension=php_openssl.dll
HTTPS现在应该可以在php中为您工作.
HTTPS should now work for you from within php.
这篇关于安装Windows版Composer-无法找到包装器"https"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!