手揣网教程:绿色安全纯净官方版,体验当今速度最快的浏览器!

ElastaticSearch的版本兼容问题以及处理方案

时间:2024/11/1作者:未知来源:手揣网教程人气:

[摘要]环境:Ubuntu:Linux iZ620vnh79jZ 3.13.0-86-generic #130-Ubuntu SMP Mon Apr 18 18:27:15 UTC 2016 x86_64 ...
环境:
Ubuntu:
Linux iZ620vnh79jZ 3.13.0-86-generic #130-Ubuntu SMP Mon Apr 18 18:27:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
 
PHP版本:
PHP 5.5.9-1ubuntu4.21 (cli) (built: Feb9 2017 20:54:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo
 
Mysql版本:
mysqlVer 14.14 Distrib 5.5.52, for debian-linux-gnu (x86_64) using readline 6.3
 
在搭建ElastaticSearch以后,访问需求端口会出现:
Your version of PHP / json-ext does not support the constant 'JSON_PRESERVE_ZERO_FRACTION',".
" which is important for proper type mapping in Elasticsearch. Please upgrade your PHP or json-ext.\n".
"If you are unable to upgrade, and are willing to accept the consequences, you may use the allowBadJSONSerialization()".
" method on the ClientBuilder to bypass this limitation.
 
这是Elastic的库中出现的问题,对于JSON_PRESERVE_ZERO_FRACTION,该常量是在PHP5.6版本之后才引出来的。所以,此处要写兼容的,解决方案如下:
if(!defined('JSON_PRESERVE_ZERO_FRACTION'))
{
define('JSON_PRESERVE_ZERO_FRACTION', 1024);
}
问题解决!

Linux是一套免费使用和自由传播的类Unix操作系统



关键词:ElastaticSearch的版本兼容问题以及处理方案




Copyright © 2012-2018 手揣网教程(http://www.shouchuai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版