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

时间:2015-09-05 12:47:32

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

我在我的webApp中使用http://simplehtmldom.sourceforge.net/file_get_contents()file_get_contents()在localhost上正常工作。但是当在服务器上上传webApp(Windows server 2012 r2)时,我收到此错误。如何解决此错误?

> 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

1 个答案:

答案 0 :(得分:0)

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

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

有关详细答案,您可以在此处查看:https://stackoverflow.com/questions/34590842/cannot-install-composer-on-mac-os-x/34617315