The openssl extension is required for SSL/TLS protection
The same error occurred to me. I fixed it by turning off TLS for Composer, it's not safe but I assumed the risk on my develop machine.
try this:
composer config -g -- disable-tls true
and re-run your Composer. It works to me!
But it's unsecure and not recommended for your Server. The official website says:
If set to true all HTTPS URLs will be tried with HTTP instead and no network-level encryption is performed. Enabling this is a security risk and is NOT recommended. The better way is to enable the php_openssl extension in php.ini.
If you don't want to enable unsecure layer in your machine/server, then setup your php to enable openssl and it also works. Make sure the PHP Openssl extension has been installed and enable it on php.ini file.
To enable OpenSSL, add or find and uncomment this line on your php.ini file:
Linux/OSx:
extension=php_openssl.so
Windows:
extension=php_openssl.dll
And reload your php-fpm / web-server if needed!
UPDATE:
As of PHP 7.4 the extension is named extension=openssl
(known for Windows).
Can't use openssl extension for SSL/TLS protection
...This was due to something wrong with my PHP-install. What I finally did (which is a kinda bad solution) was to install xampp just to get a correct php version. Then I went to my PATH (winbtn + break(paus) ---> Advanced system settings ---> Environment Variables) and re-routed the php to the xampp php version and VOILA! It works. So either dig in to make a proper PHP install or YOLO like me and add xampp just to get a correct php and then it should work. GL HF!
Related Topics
How to Change Maximum Number of Post Variable in PHP
PHP Pdo Prepared Statement - MySQL Like Query
Running Command-Line Application from PHP as Specific User
Fatal Error: Cannot Use Object of Type MySQLi_Result
MySQLi_Fetch_Array While Loop Columns
How to Setup Elasticsearch Index Structure With Multiple Entity Bindings
How to Detect a Create, Update, Delete Query Is Successful in Codeigniter
Laravel Migration: Unique Key Is Too Long, Even If Specified
How to Import a .SQL File in MySQL Database Using PHP
How to Override the Path of PHP to Use the Mamp Path
Curl Error: Recv Failure: Connection Reset by Peer - PHP Curl
How to Retrieve Request Payload
Difference Between Session_Unset() and Session_Destroy() in PHP