CakePHP错误允许内存大小耗尽 [英] CakePHP error Allowed memory size exhausted
问题描述
在我的一个PHP应用程序中,我得到了允许的内存大小耗尽的错误。
On one of my PHP applications I get Allowed memory size exhausted error.
我做错了什么错误得到这个错误?
What did i done wrong to get that error?
它显示在页面上,我使用更多的通常的cakephp方法,如'find',从数据库表,索引(列表)页面中选择记录。
It's showing on pages where i use more-less usual cakephp methods like 'find', to select record from database table, on index (list) pages.
我如何解决这个问题?问题是我不能在商业服务器上设置内存大小....
How can i fix that? problem is that i can not set memory size on commercial servers....
提前感谢!
推荐答案
研究您的模型的可容纳行为。这是一个核心行为,它听起来像你需要添加到你的发现,以限制他们回拉的数据量。此外,开始查看用自定义查询替换查找,以加快速度,并进一步限制返回的数据量。
Research the 'Containable' behavior for your models. It's a core behavior, and it sounds like you need to add it to your finds, to limit the amount of data they're pulling back. Also, start looking at replacing finds with custom queries to speed things up and further limit the amount of data being returned.
这篇关于CakePHP错误允许内存大小耗尽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!