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

simplehtmldom - SSL operation failed with code 1. OpenSSL Error messages

我在我的 webApp 中使用 http://simplehtmldom.sourceforge.net/file_get_contents()file_get_contents() 在本地主机上工作正常。但是当在服务器(Windows 服务器 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 设置为从以下 link 下载的 ssl-certificate 的 PEM 文件的路径:http://curl.haxx.se/ca/cacert.pem.

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

详细的解答可以看这里: