composer not install in windows 7

2020-02-04 20:34发布

I already uncommented in php.ini:

[PHP]

;;;;;;;;;;;;;;;;;;;
 ; About php.ini ;
;;;;;;;;;;;;;;;;;;;

;extension=php_oci8_11g.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll

Variables of the system set ok.

PHP version 5.4.16:

  C:\wamp\bin\php\php5.4.16\php.exe

Add to System path variable:

  C:\ProgramData\ComposerSetup\bin

But, recive this error:

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'm using:

  • windows 7
  • Wamp
  • php 5.1.16
  • apache 2.4.4

How solve this problem, please help me.

12条回答
小情绪 Triste *
2楼-- · 2020-02-04 21:13
The star\"
3楼-- · 2020-02-04 21:13
  1. Find a php.ini in C:\wamp\bin\php\php5.4.16\ (the configuration file of PHP).
  2. Remove ; in lines ;extension=php_openssl.dll and ;extension_dir = "ext". PHP will know that you are using a php_openssl extension and extension_dir is the location of extensions (you can see it in the comment above php_openssl).
  3. Run the Windows command prompt with administrator permissions.
  4. Execute the following command: mklink C:\Windows\php.ini C:\wamp\bin\php\php5.4.16\php.ini

Composer search php.ini in C:\Windows\php.ini and you have your PHP in WAMP. With mklink command you create a link php.ini that aim to your WAMP's php.ini.

查看更多
Emotional °昔
4楼-- · 2020-02-04 21:15

The problem solved after turn off windows firewall.

installation complete!

查看更多
Juvenile、少年°
5楼-- · 2020-02-04 21:16

For MAMP users, this is what worked for me.

If your php.ini is located under a \MAMP\conf\

  1. copy the php.ini into a\MAMP\bin\php\php[your PHP version number]\
  2. Restart MAMP and the command-line window
  3. Go to a directory under a command-line window where you want to install composer
  4. run from a command line: php -r "readfile('http://getcomposer.org/installer');" | php

NOTE: it is http not https !

END

查看更多
爷、活的狠高调
6楼-- · 2020-02-04 21:20

i was facing the same issue but i fixed that,

if you are using wamp

goto your selected php version directory and then you need to edit that directory php.ini file

replace this line ;extension=php_openssl.dll to extension=php_openssl.dll and save and then restart then it will be working :)

查看更多
\"骚年 ilove
7楼-- · 2020-02-04 21:20

I was facing the same issue in windows 7 PC with xampp.

Cannot open '\xampp\php\extras\browscap.ini' for reading in Unknown on line 0

I just change the value of 'browscap' in php.ini file. Use full path instead of absolute path.

In my case Xampp was in E drive so I have changed browscap="\xampp\php\extras\browscap.ini" to browscap="E:\xampp\php\extras\browscap.ini"

And it works for me!

查看更多
登录 后发表回答