How to enable PHP's openssl extension to insta

2020-01-26 03: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 screenshot of the message.

enter image description here

18条回答
在下西门庆
2楼-- · 2020-01-26 03:32

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.
查看更多
Lonely孤独者°
3楼-- · 2020-01-26 03:32

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'

查看更多
时光不老,我们不散
4楼-- · 2020-01-26 03:36

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
查看更多
放我归山
5楼-- · 2020-01-26 03:36

This is an old question but I just had the same issue (with PHP7) and the solution was, in the end, pretty simple. Uncommenting the line in php.ini as per the other answers wasn't quite enough though. I needed to change it from:

;extension=php_openssl.dll

to:

extension=ext/php_openssl.dll

Note the ext prefix. The dll already existed but was in a subfolder. After changing the config the composer installer was happy.

查看更多
来,给爷笑一个
6楼-- · 2020-01-26 03:36

After editting the "right" files (all php.ini's). i had still the issue. My solution was:

  1. Adding a System variable: OPENSSL_CONF

    the value of OPENSSL_CONF should be the openssl.cnf file of your current php version.

for me it was:

  • C:\wamp\bin\php\php5.6.12\extras\ssl\openssl.cnf

-> Restart WAMP -> should work now

Source: http://php.net/manual/en/openssl.installation.php

查看更多
干净又极端
7楼-- · 2020-01-26 03:40

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.

查看更多
登录 后发表回答