How to enable PHP's openssl extension to install Composer?

后端 未结 18 1017
臣服心动
臣服心动 2020-11-27 12:29

I am trying to install Laravel in WAMP setup. I am getting a warning message for not enabling openssl which I had already done in WAMP.

Here is a sc

相关标签:
18条回答
  • 2020-11-27 13:05

    It is possible that WAMP and Composer are using different PHP installations. Composer will use the PHP set in the PATH environment variable.

    If you want to enable the openssl extension to install Composer, first you need to check the location of the PHP installation.

    1. Open a Command Prompt, type: echo %PATH% then check for the location of your PHP installation.
    2. Go to that location and edit the file named: php.ini.
    3. Uncomment the line extension=php_openssl.dll by removing the semicolon at the beginning.

    Now you are good to install Composer.

    0 讨论(0)
  • 2020-11-27 13:06

    For WAMP server, comment given by "Enrique" solved my problem.

    wamp is using this php.ini:

    c:\wamp\bin\apache\Apache2.4.4\bin\php.ini
    

    But composer is using PHP from CLI, and hence it's reading this file:

    c:\wamp\bin\php\php5.4.12\php.ini (so you need to enable openssl there)
    

    For composer you will have to enable extension in

    c:\wamp\bin\php\php5.4.12\php.ini
    

    Change:

    ;extension=php_openssl.dll 
    

    to

    extension=php_openssl.dll
    
    0 讨论(0)
  • 2020-11-27 13:08

    you need to enable the openssl extension in

    C:\wamp\bin\php\php5.4.12\php.ini 
    

    that is the php configuration file that has it type has "configuration settings" with a driver-notepad like icon.

    1. open it either with notepad or any editor,
    2. search for openssl "your ctrl + F " would do.
    3. there is a semi-colon before the openssl extension

      ;extension=php_openssl.dll
      

      remove the semi-colon and you'll have

      extension=php_openssl.dll
      
    4. save the file and restart your WAMP server after that you're good to go. re-install the application again that should work.
    0 讨论(0)
  • 2020-11-27 13:08

    There are two php.ini files, one for development and one for production. Leave those, there is another php.ini file for configuration settings just above them with a gear like icon edit that.

    0 讨论(0)
  • 2020-11-27 13:09

    If you're doing this on Windows without one of the WAMP stacks, here's how to get this going

    1. Download an installation of PHP for Windows. Generally you'll want a non-thread safe install. You can use 32-bit or 64-bit builds
    2. Extract the zip file somewhere. I would suggest C:\php. Composer's installer found it there without any additional prompting
    3. The latest versions of PHP for Windows do not come with a php.ini by default. Instead, you'll see two files, as noted below. Rename one to php.ini or copy it into php.ini.
      • php.ini-development
      • php.ini-production
    4. Open your php.ini file and remove the semicolon from this line (you might want to uncomment other things as well but this line is the only one necessary for Composer)

      ;extension=php_openssl.dll
      

    That should be all you need to do. The Composer installer should do everything else you need from here.

    0 讨论(0)
  • 2020-11-27 13:09

    C:\wamp\bin\php\php5.3.13

    Browse to the line that reads:

    ;extension=php_openssl.dll
    

    and remove the semicolon preceding the line. Restart your WAMP server services (click in your icon tray > 'Restart All Services'

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