composer the openssl extension is required for ssl/tls protection mamp
I have tried to instal laravel 5.5 in my windows sytem at MAMP. When I run Laravel global command “composer global require “laravel/installer”” I have faced the error like below.
composer the openssl extension is required for ssl/tls protection but it is not available. If you cannot enable the openssl extension. you can disable this error, at you own risk, by setting the ‘disable-tls’ option to true.
I have finally realised there is no Openssl enabled in my system.
I have checked my phpinfo(), But it says openssl was enabled here. I just confused and checked my PHP.ini file @C:\MAMP\conf\php7.0.13
There my extention extension=php_openssl.dll is enabled
and extension_dir = "C:\MAMP\bin\php\php7.0.13\ext\" also enabled.
After few research I have found there are 2 php.ini files in your MAMP settings.
You can find another php.ini file @C:\MAMP\bin\php\php7.0.13
There you can see 2 files
How to fix it :
A. Copy php.ini-development to php.ini
B. Uncomment the extension=php_openssl.dll line as described
C. Uncomment this line: extension_dir = "C:\MAMP\bin\php\php7.0.13\ext\"
D. Make sure you find php_openssl.dll within that extension directory of course
E. Restart your MAMP.
Finally everything becomes normal and you can start to install laravel.
If nothing works above just run the below command to disable SSL security. The everything will work as expected.
composer config -g -- disable-tls true
May you will face ext-mbstring extension missing error next step. To fix this just enable ext-mbstring.dll in you php.ini file.
Hope it will help someone.