laravel Elasticsearch-PHP 需要 curl 或自定义 http 处理程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38498071/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Elasticsearch-PHP needs curl or custom http handler
提问by Muhammad Mu'az
i'm deploy laravel 5.2 to ubuntu and installed elasticquent lib and elasticsearch 2.3.4 , when i try to figure the result of aggregation :
当我尝试计算聚合结果时,我将 laravel 5.2 部署到 ubuntu 并安装了 elasticquent lib 和 elasticsearch 2.3.4:
RuntimeException in ClientBuilder.php line 144:
Elasticsearch-PHP requires cURL, or a custom HTTP handler.
I already install curl using command sudo apt-get install php5-curl and its still display the same error
我已经使用命令 sudo apt-get install php5-curl 安装了 curl 并且它仍然显示相同的错误
How to fix it?
如何解决?
Thank you
谢谢
回答by JRR
sudo apt-get install php-curl
Try this, it will install curl as per your version of php.
试试这个,它会根据你的 php 版本安装 curl。
回答by Morilog
You must run sudo apt-get install curl php5-curl
to install curl and its php extension, if you are using PHP7, you must install php7.0-curl
instead of php5-curl
您必须运行 sudo apt-get install curl php5-curl
以安装 curl 及其 php 扩展,如果您使用的是 PHP7,则必须安装php7.0-curl
而不是php5-curl