P粉4623289042023-08-24 15:10:46
This problem is caused by openssl and extension directories, so please uncomment the following extensions in the
php.ini
extension=php_openssl.dll
extension_dir = "ext"
It works on my machine.
P粉2371257002023-08-24 13:38:06
I also encountered the same error. I fixed the issue by turning off TLS for Composer, which wasn't secure, but I took the risk on my development machine.
Try this:
composer config -g -- disable-tls true
And re-run your Composer. This works for me!
But it is not secure and is not recommended for use with your server . The official website says:
If you don't want to enable the insecure layer in your computer/server, then set up your php to enable openssl and it will work too . Make sure you have the PHP Openssl extension installed and enabled in the php.ini file.
To enable OpenSSL, add or find and uncomment this line in the php.ini file:
Linux/OSx:
extension=php_openssl.so
Windows:
extension=php_openssl.dll
Reload your php-fpm/web server if necessary!
renew:
Starting with PHP 7.4, the extension is extension=openssl
(known in Windows).