Error when retrieving associated data on. Linux only

那年仲夏 提交于 2019-12-02 09:46:33

The problem is, probably, the way you are loading the associations. You are required to tell Cake in what plugin your table class lives. Instead of doing this:

$this->hasMany('ArticleComments')

You need this:

$this->hasMany('Comments.ArticleComments')

Problem solved!

The issue was not coming from Linux nor CakePHP.

On my local machine which happens to be Windows OS I am running MySQL version 5.6.24 and on my live server, which runs Linux debian I have MySQL 5.5.46.

I had database columns "datetime" which is supported in 5.6 but was causing a problem in version 5.5.

I simply changed the column type to "timestamp" and the issue was resolved.

Both environments are running different OS's and an enormous amount of time was spent to ensure the issue is not Windows to Linux problem(i.e. filename case sensitivity). CakePHP misleading error messages has delay me to resolve the problem also.

I am glad after more than a month the problem is fixed :D

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!