doupin8555 2013-09-10 22:13
浏览 31
已采纳

为什么这个php致命错误信息显示?

I'm a novice PHP programmer and not so knowledgeable abouts bits and bytes, and I was wondering why this message even shows up:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40 bytes) in D:\xampp1.8.3\htdocs\hkmschat\default.php on line 227

I know my website is very large, but it loads fast enough, and it would be a pain to change it.

I was wondering, why is allocating 40 bytes too much when the allowed memory size is 134217728 bytes (128 megabytes). Can somebody help me with the meaning of "the allowed memory size" and "allocated memory". Again, I don't know much about these.

I've also changed php.ini's memory_limit value to "256M", but it didn't work then. the error just changed to

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 40 bytes) in D:\xampp1.8.3\htdocs\hkmschat\default.php on line 227

Can somebody please inform me on what I'm missing?

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • doupu3635 2013-09-10 22:16
    关注

    It's not trying to JUST allocate 40 bytes. You already have 128Megs of stuff loaded into memory, and it is trying to then load 40 bytes more. This puts you over the limit, and you get the fatal error. As for the php.ini, there are several versions of php.ini that could be being used. you should use a test page and use a phpinfo(); call to determine that you are modifying the correct php.ini.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab