错误:已用完允许的 67108864 字节的内存大小 [英] Error: Allowed memory size of 67108864 bytes exhausted

查看:33
本文介绍了错误:已用完允许的 67108864 字节的内存大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我上传图片时

  • 文件大小:375kb
  • 宽度:2000 像素
  • 高度:3000 像素

出现错误

错误致命错误:允许的 67108864 字节的内存大小已用尽(试图分配 2157 字节) in...

ERROR Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2157 bytes) in...

为什么会发生这种情况,当 67108864 = 64MB 时?

Why this happen, when 67108864 = 64MB?

我使用共享服务器.我的 .htaccess 是:

I use a shared server. My .htaccess is:

<IfModule mod_rewrite.c> 
   RewriteEngine on 
   RewriteRule    ^$ webroot/    [L] 
   RewriteRule    (.*) webroot/$1 [L] 

</IfModule> 

我必须在哪里写php_value memory_limit 128M?

推荐答案

看来你只有 64M (67108864/1024/1024) 分配给 PHP.

It seems you only have 64M (67108864 / 1024 / 1024) allocated to PHP.

如果您可以访问 php.ini,请增加最大内存大小.

If you have access to your php.ini, increase the max memory size.

您也可以在引导 PHP 脚本中执行此操作.

You can also do it in a bootstrap PHP script.

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

甚至在你的 .htaccess

php_value memory_limit 128M

这篇关于错误:已用完允许的 67108864 字节的内存大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆