Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

php - Installing Composer for Windows - unable to find wrapper "https"

I am trying to install Composer for Windows using the command line with the following call:

php -r "readfile(https://getcomposer.org/installer);" | php

However, I get this error message:

Warning: readfile(): Unable to find the wrapper "https" - did you forget to enable it when configured PHP? in Command line code on line 1

Call Stack: 0.0010 224336 1. {main}() Command line code:0 0.0010 224488 2. readfile() command line code:1

Warning: readfile(https://getcomposer.org/installer): failed to open stream: invalid argument in Command line code on line 1

Call Stack: 0.0010 224336 1. {main}() Command line code:0 0.0010 224488 2. readfile() Command line code:1

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:

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've tried including this --with-openssl flag at various places but it doesn't seem to be doing the trick.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This sounds like your installation hasn't got openssl enabled.

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

remove the semi-colon

extension=php_openssl.dll

HTTPS should now work for you from within php.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...