无法使用 openssl 扩展进行 SSL/TLS 保护

Can't use openssl extension for SSL/TLS protection

我 运行 Windows 10 岁,正在使用 Laravel 5.4,homestead 2.0,使用 VM 和 Vagrant。一切正常...除了我 运行 "laravel new blog" 我得到:

  [Composer\Exception\NoSslException]
  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.

我知道还有其他一些关于此的问题,但似乎还没有找到一个好的答案。此外,关于此的大多数其他问题都是关于 WAMP 的......因此我认为在使用 VM 时再次询问是相关的。

我已经删除了; (分号)在我的 php.ini-development 和 php.ini-production 中的 extension=php_openssl.dll 前面。错误仍然存​​在。

当我在命令行中检查 openssl 版本时,我有: OpenSSL 1.0.2k 2017 年 1 月 26 日

...这是因为我的 PHP- 安装有问题。我最后做的(这是一个有点糟糕的解决方案)是安装 xampp 只是为了获得正确的 php 版本。然后我去了我的 PATH (winbtn + break(paus) ---> Advanced system settings ---> Environment Variables) 并将 php 重新路由到 xampp php 版本瞧!有用。因此,要么深入研究以进行正确的 PHP 安装,要么像我一样添加 YOLO 并添加 xampp 以获得正确的 php 然后它应该可以工作。 GL 高频!