【发布时间】:2015-10-20 06:24:58
【问题描述】:
我正在尝试让 FOSElasticaBundle 工作。 ElasticSearch 实例在 localhost:9200 上运行并响应。
我按照文档https://github.com/FriendsOfSymfony/FOSElasticaBundle/blob/master/Resources/doc/setup.md中的每个步骤进行操作
但在最后一步,我在控制台中收到此错误:
c:\xampp\htdocs\my\folder>php app/console fos:elastica:populate
Resetting app
Fatal error: Wrong parameters for Exception([string $exception [, long $code [,
Exception $previous = NULL]]]) in C:\xampp\htdocs\my\folder\vendor\rufli
n\elastica\lib\Elastica\Exception\ResponseException.php on line 34
[Symfony\Component\Debug\Exception\FatalErrorException]
Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
fos:elastica:populate [--index[="..."]] [--type[="..."]] [--no-reset] [--offset="..."] [--sleep="..."] [--batch-size="..."] [--ignore-errors] [--no-overwrite-format]
似乎“__construct”-Function 必须有 3 个参数,但其中只有 2 个。我只是尝试添加“NULL”参数以使其工作,但随后另一个函数引发错误。
public function __construct(Request $request, Response $response)
{
$this->_request = $request;
$this->_response = $response;
parent::__construct($response->getError());
}
这是一个常见问题吗?我该如何解决?
【问题讨论】:
-
stackoverflow.com/questions/21684388/… 的可能重复项(您必须将 PHP 版本更新到 5.3)
-
我的 PHP 版本是 5.6.3
-
好的,你说得对,这不是PHP版本的问题。看代码,问题一定是$response->getError()没有返回字符串。我查看了代码,无法弄清楚为什么会发生这种情况。
-
你找到什么了吗?同样的问题。
-
我在将 elasticsearch 1.7.3 升级到 2.0 时遇到了这个问题,这不是 foselastica 的问题,而是 foselastica 使用的 ruflin/Elastica 的问题,我已将票移到那里:@987654323 @
标签: symfony exception elastica foselasticabundle