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 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的