SSL / TLS保护需要openssl扩展 [英] The openssl extension is required for SSL/TLS protection
问题描述
composer create-project flarum/flarum . --stability=beta
我尝试运行此命令,但它给我这个错误。 p>
I try to run this command, but it gave me this error.
[RuntimeException]
The openssl extension is required for SSL/TLS protection but is not availab
le. 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.
我试图添加extension = php_openssl.dll到php.ini有这个错误
I tried to add "extension=php_openssl.dll" to "php.ini", but it still got this error
推荐答案
我发生了同样的错误。我通过关闭Composer的TLS来修复它,它不安全,但我承担了我的开发机器的风险。
The same error ocurred to me. I fixed it by turning off TLS for Composer, it's not safe but I assumed the risk on my develop machine.
试试这个:
composer config -g -- disable-tls true
并重新运行Composer。它适用于我!
and re-run your Composer. It works to me!
但它不安全,不推荐用于您的服务器。 theicial网站说:
But it's unsecure and not recommended for your Server. The oficial website says:
如果设置为true,则将使用HTTP尝试所有HTTPS URL,而不执行网络级加密。启用这是一个安全风险,不推荐。更好的方法是在php.ini中启用php_openssl扩展。
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.
如果你不想在你的机器中启用不安全层/ server,然后设置您的php以启用openssl,它也可以工作。确保PHP Openssl扩展已安装并在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 be installed and enable it on php.ini file.
这篇关于SSL / TLS保护需要openssl扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!