CakePHP:致命错误:允许的内存大小为 536870912 字节已用完(尝试分配 52 字节)

CakePHP : Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 52 bytes)(CakePHP:致命错误:允许的内存大小为 536870912 字节已用完(尝试分配 52 字节))
本文介绍了CakePHP:致命错误:允许的内存大小为 536870912 字节已用完(尝试分配 52 字节)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个在 CakePHP v 1.3 上运行的应用程序.我已将 wamp 服务器更新为 v2.4.更新后我收到此错误消息.我对 php.ini 设置进行了这些更改.

Hi i have a apps running on CakePHP v 1.3. I've updated my wamp server to v2.4.After updating i got this error message.I did these changes into my php.ini settings.

  • memory_limit = 128M
  • file_uploads = 开启
  • upload_max_filesize = 128M
  • max_input_time
  • 最大执行时间 = 300
  • post_max_size = 128M
  • realpath_cache_size = 16k
  • realpath_cache_ttl = 120

但我仍然收到这些错误消息:

But i'm still getting these Error message :

CakePHP : Fatal error: Allowed memory size of 536870912 bytes exhausted 
(tried to allocate 52 bytes) in C:wampwwwgtgcrmcakelibsmodel
datasourcesdbodbo_mysql.php on line 775

我错过了什么?任何建议将不胜感激!

What i missed ? Any Suggestion will be appreciated !

推荐答案

您可以通过在控制器操作中使用来增加内存限制

You can increase memory limit by using in your controller action

ini_set('memory_limit', '256M');

你也可以增加超时限制

set_time_limit(0); Infinite

这篇关于CakePHP:致命错误:允许的内存大小为 536870912 字节已用完(尝试分配 52 字节)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Codeigniter htaccess to remove index.php and www(Codeigniter htaccess 删除 index.php 和 www)
htaccess mod_rewrite part of url to GET variable(htaccess mod_rewrite url 的一部分到 GET 变量)
Replacing a querystring parameter value using mod_rewrite(使用 mod_rewrite 替换查询字符串参数值)
.htaccess in subdirectory #39;overriding#39; parent htaccess(子目录“覆盖父 htaccess 中的 .htaccess)
How to rewrite SEO friendly url#39;s like stackoverflow(如何像stackoverflow一样重写SEO友好的url)
Is it okay to have a very long .htaccess file?(有一个很长的 .htaccess 文件可以吗?)