Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$_SERVER['REQUEST_TIME'] 的类型不同会导致排序出现问题 #58

Open
xraywu opened this issue Aug 13, 2019 · 0 comments
Open

$_SERVER['REQUEST_TIME'] 的类型不同会导致排序出现问题 #58

xraywu opened this issue Aug 13, 2019 · 0 comments

Comments

@xraywu
Copy link

xraywu commented Aug 13, 2019

版本信息:

  • 操作系统: Ubuntu 18.04
  • PHP 7.2
  • 扩展 tideways.so 4
  • MongodDB 3.4

具体报错信息:

之前在生产环境观察到一个奇怪的现象。生产环境同一个 PHP 运行了一个 wordpress 实例和我们自己的站点服务,最后发现在 xhgui 中”最近运行“ 展示的只有 wordpress 内的日志,但mongo中确实采集到了自己的站点日志。检测发现是 $_SERVER['REQUEST_TIME'] 在 wp 中会被转为 string 类型,而我们自己站点里面是 int 类型,导致mongo无法正确进行排序。建议在 headers.php 中对这个字段类型强制转化一下。

e.g. headers.php 176行添加 $_SERVER['REQUEST_TIME'] = (string)$time;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant