When trying to install a package through Composer, I got the following messages:
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error , at your own risk, by setting the 'disable-tls' option to true.
After solving the openssl issue, I got another message:
Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.
Here’s what I did to solve it:
which phpin the terminal to find out which PHP is being used on the local machine.
- According to the path you got, open the file explorer and navigate to the folder where php.exe is located. I use “Local WP” to run the local PHP environment so this folder was something like:
- In this folder, look for the
php.inifile. If there are only
php.ini-productionfiles - rename one of these files to
- Edit the
;extension_dir = "ext"by removing the
;at the beginning.
;extension=curl- to solve the curl issue.
;extension=openssl- to solve the openssl issue.
- Save the file.
- Restart the terminal and try again.