dongshiliao7990 2014-01-14 18:08
浏览 72
已采纳

PHP内存不足,但仅限于一个系统

I have been working for the last few months on a CakePHP application.
Most of this time I was developing on Lubuntu, using lampp package.
Everything works fine in this setting, as it does on two different remote servers I have access to.
Few days ago circumstances forced me to move with the development to a laptop device with Windows 7 as an OS.
And the application doesn't work here. php_error_log contained Allowed memory size of 134217728 bytes exhausted.
I've switched memory_limit to -1 in php.ini, and now it's PHP Fatal error: Out of memory (allocated 1488453632) (tried to allocate 15470592 bytes)
This smells like an infinite loop, but the application still works correctly on other servers. And other applications, including freshly downloaded Cakephp package, work fine on this device.

I'm confused with the apparent exclusiveness of this error. I can provide additional information if you tell me what should I check.

Update:
-recursive was at 3, but setting it to -1 haven't changed anything. Also, in most cases we set recursive individually for each find(...) call.
-setting debug to 0 brings no noticeable changes.

Update2:
I have solved the issue, sort of. I'll Provide details in the answer.

  • 写回答

2条回答 默认 最新

  • dpgua04022 2014-01-27 17:15
    关注

    I have found the source of the problem, although I only understand it partially. The reason lies in \lib\Cake\Model\Datasource\CakeSession.php :

    if (ini_set($setting, $value) === false) {
    throw new CakeSessionException(sprintf(
        __d('cake_dev', 'Unable to configure the session, setting %s failed.'),
        $setting
    )); }
    

    This line was throwing the exception over and over for setting session.auto_start. It appears that the expression 0 === false incorrectly returned true. I assume that because phpinfo() displays that session.autostart is off. I could print out the value just before the block in question, but if for some unknown reason comparison really is wrong, then why would printing be correct? I don't have the time to investigate this further. I have commented the exception for the time of development. On production server everything works fine.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog