从不同环境检索数据时,结果不同 [英] Different results when retrieving data from different environments

查看:101
本文介绍了从不同环境检索数据时,结果不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在运行Windows 10的本地环境中完成了一个项目。生产服务器具有Debian OS

I've completed a project in my local environment running Windows 10. The production server has Debian OS

我遇到了一个问题。尽管我的本地env和prod env都在同一个Cakephp版本3.1.4上运行,但以下Cakephp数据库查询

I encountered an issue. Despite both my local env and prod env being run on the same Cakephp version, version 3.1.4, the following Cakephp database query

 $this->Articles->find()->contain('ArticleComments'); 

从存储在两个不同环境中的同一数据库返回两个不同的结果。

is returning two different results from an identical database stored in two different environments.

附上包含两个结果的图像。

Attached an image which contains both results.

任何想法可能是什么问题?从Cakephp的角度来看,配置已正确设置。在我的本地环境中,应用程序和数据库查询运行顺利。

Any idea what could be the problem? From Cakephp point of view configuration is set correctly. In my local env the application and database queries are running smoothly.

图片:

推荐答案

您可能在Debian Server上安装了较旧的PHP版本,但该版本尚不支持神奇的 __ debugInfo()方法(自PHP 5.6.0起可用),由Cakes Query类用于用自定义信息修饰调试输出。

You probably have an older PHP version on your Debian Server, one that doesn't yet support the magic __debugInfo() method (available as of PHP 5.6.0), which is used by Cakes Query class to decorate the debug output with custom information.

如果要使用Cakes debug()函数,您应该获得相同的结果(AFAIR)。

If you'd use Cakes debug() function you should get identical results (AFAIR).

另请参见

  • http://php.net/manual/en/language.oop5.magic.php#object.debuginfo
  • Source > \Cake\ORM\Query::__debugInfo()

这篇关于从不同环境检索数据时,结果不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆