我在我的 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/