我一直在尝试使用Elasticsearch PHP API,在本地弹性搜索服务器上使用它完美地工作,我可以索引和搜索但是当我尝试在我的网络服务器上做同样的事情时,在documentation中使用like就是给我的以下错误:
Elasticsearch\Common\Exceptions\NoNodesAvailableException Object
(
[message:protected] => No alive nodes found in your cluster
[primary_port] => 9200
(...)
[local_ip] => 192.168.2.4
[local_port] => 64641
[error] => SSL certificate problem: unable to get local issuer certificate
[errno] => 60
我在互联网上搜索并尝试:1 . 下载最新的cacert.pem 2.转到XAMPP php.ini并添加curl.cainfo =“C:/xampp/php/cacert.pem”行3.重新启动xampp和apache .
它什么也没做,所以我认为这可能是因为弹性搜索的PHP APi,但我不知道它是什么 .
随意请求任何东西 . 谢谢!
EDIT:
我在localhost上测试这个,但是当我通过https连接在线时,它给了我同样的错误 .
2 回答
If you use xampp, please read the following article which is pretty clear to understand why this happens and how to solve it
再次打开php.ini文件并搜索[curl]区域,现在我们将取消注释并更改curl.cainfo和openssl.cafile属性的值 .
您的证书路径可能会有所不同,因此我建议您阅读该文章 .
将此行添加到您的php.ini并重新启动xampp