繁体   English   中英

Laragon 下的 PHP - SSL 操作失败,代码为 1

[英]PHP under Laragon - SSL operation failed with code 1

我在 Windows 10 上使用Laragon 4.0.16 在 PHP 中进行开发。

我使用 Laragon 工具启用了 SSL :

在此处输入图像描述

还将 laragon.crt 添加到 Trust Store。

在此处输入图像描述

我可以在https://project.test正确访问我的测试项目。

但是,有一个问题:

警告:getimagesize():SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:1416F086:SSL 例程验证过程证书:验证失败

我一直在阅读解决此类问题的方法是在 PHP ini 配置文件中设置curl.cainfoopenssl.cafile

我这样做了,在位于C:\laragon\bin\php\php-xxx\php.ini的 Laragon 全局php.ini中:

curl.cainfo = "C:\laragon\etc\ssl\cacert.pem"
openssl.cafile = "C:\laragon\etc\ssl\cacert.pem"

但重启 Laragon 后,php 警告仍然存在。

我还能做些什么来追踪问题并解决它?

谢谢你。

我花了几个小时试图弄清楚这个问题。 我找到的所有解决方案都说明了以下几点:

  • https://curl.haxx.se/ca/cacert.pem下载 cacert 并替换 laragon/etc/ssl/ 中的那个
  • 将 php.ini 中的 openssl.cafile 设置为 laragon\etc\ssl\laragon.crt(例如 openssl.cafile= "C:\tlaragon)

根本没有帮助。 真正起作用的是切换到 php 7.3(我的代码无法运行 7.4,我在那里遇到了不同的错误)。 The reason why seems to be that for php 7.2.19 the php_openssl.dll has the version 1.1.1b and the php_openssl.dll for version 7.3 and up has the version 1.1.1k.

这终于解决了这个问题。 我希望这可以帮助某人几个小时的疯狂。 我不确定这是否会在 php 的未来版本中再次发生:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM