composer not install in windows 7

前端 未结 12 2089
太阳男子
太阳男子 2020-12-09 12:13

I already uncommented in php.ini:

[PHP]

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

;extension=php_oci8_11g.dll
extension=php_openssl.dll
;e         


        
相关标签:
12条回答
  • 2020-12-09 12:54

    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

    0 讨论(0)
  • 2020-12-09 12:56

    The problem solved after turn off windows firewall.

    installation complete!

    0 讨论(0)
  • 2020-12-09 12:56

    Beside all of the above If php/xampp is not installed in c drive this problem occurred (what happened with me).

    In that case please follow this link : http://abuango.net/2014/08/16/how-to-install-composer-on-windows-with-xampp/

    0 讨论(0)
  • 2020-12-09 12:57
    1. Open php.ini located in your "php" folder for example in xampp the file is in XYZ:\xampp\php\

    2. Find "extension=php_openssl.dll"

    3. ";extension=php_openssl.dll" - remove ";"

    4. Restart your xampp (or whatever u use), extension should be loaded after that.

    5. Try agien to install composer.

    0 讨论(0)
  • 2020-12-09 13:00
    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.

    0 讨论(0)
  • 2020-12-09 13:02

    I have battled this several times. And this is the best solution I have found.

    As mentioned, you need to ensure that extension=php_openssl.dll is enabled but doing just that sometimes may not resolve the error.

    You should check that you have PHP on your path variable then see what INI file is loaded by typing php --ini in the console it should give you something like:

    Configuration File (php.ini) Path: C:\WINDOWS
    Loaded Configuration File:         C:\WINDOWS\php.ini
    Scan for additional .ini files in: (none)
    Additional .ini files parsed:      (none)
    

    Make sure you are enabling the settings in the correct ini file. If you dont have an ini file loaded put an ini file from the php directory into c:\windows.

    Also important I find it helps to change the extension_dir flag to an absolute path from relative to makesure the system can find php_opensll.dll.

    To do this uncomment the line starting extension_dir and change it to match from the drive root.

    Example: C:\php\ext instead of ext/

    0 讨论(0)
提交回复
热议问题