PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, December 31, 2021

[FIXED] Different results when retrieving data from different environments

 December 31, 2021     cakephp, cakephp-3.0, linux     No comments   

Issue

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

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.

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.

Image: enter image description here


Solution

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.

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

See also

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


Answered By - ndm
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing