ssl - simplehtmldom - SSL 操作失败,代码为 1。OpenSSL 错误消息

标签 ssl file-get-contents simple-html-dom

我在我的 webApp 中使用 http://simplehtmldom.sourceforge.net/file_get_contents()file_get_contents() 在本地主机上运行良好。但是当在服务器(Windows server 2012 r2)上上传 webApp 时,我得到了这个错误。如何修复此错误?

> Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in E:\cfnic.com\includes\class\PHP_Simple_HTML_DOM_Parser.php on line 75

Warning: file_get_contents(): Failed to enable crypto in E:\cfnic.com\includes\class\PHP_Simple_HTML_DOM_Parser.php on line 75

Warning: file_get_contents(https://www.markafoni.com/kadin/): failed to open stream: operation failed in E:\cfnic.com\includes\class\PHP_Simple_HTML_DOM_Parser.php on line 75

Fatal error: Call to a member function find() on boolean in E:\cfnic.com\includes\theme\category.php on line 159

最佳答案

您基本上必须将环境变量 SSL_CERT_FILE 设置为从以下链接下载的 ssl 证书的 PEM 文件的路径:http://curl.haxx.se/ca/cacert.pem .

我花了很多时间才弄明白这一点。

详细的解答可以看这里:https://stackoverflow.com/questions/34590842/cannot-install-composer-on-mac-os-x/34617315

关于ssl - simplehtmldom - SSL 操作失败,代码为 1。OpenSSL 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32413221/

相关文章:

html-parsing - 简单的 HTML Dom 解析器 : How to insert to elements

php - 我们如何使用简单的 html dom 获取特定链接

php - 用于微数据的简单 HTML DOM 解析器

mobile - 所有移动设备都支持 SSL 吗?

c++ - Qt 本地安全网络套接字

php - session 数据的 file_get_contents(或 curl 或 fopen)问题

php - file_get_contents 的超时在 PHP 中不起作用

django - 让我们用 uWSGI 加密

HTTP 代理 SSL 隧道中继详细信息

javascript - 当页面仍在下载时回显字符串