我想让FOSElasticaBundle正常工作。 ElasticSearch实例正在localhost:9200上运行并进行响应。在填充FOSElasticaBundle/Symfony2时ResponseExeption出错
我跟着文档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]
好像有3个参数强制“__construct” - 函数,但只有2个。我只是试图添加“NULL”参数来让它工作,但是然后另一个函数会抛出一个错误。
public function __construct(Request $request, Response $response)
{
$this->_request = $request;
$this->_response = $response;
parent::__construct($response->getError());
}
这是常见问题吗?我如何解决它?
http://stackoverflow.com/questions/21684388/wrong-parameters-for-exception-when-creating-exception-subclass(你必须更新你的PHP版本到5.3) –
我的PHP版本是5.6 .3 – RoyRobsen
好的,你说得对,这不是PHP版本的问题。看代码,问题必须是$ response-> getError()不返回一个字符串。我查看了代码,但无法弄清楚为什么会发生这种情况。 –