错误:已用完允许的 67108864 字节的内存大小

Error: Allowed memory size of 67108864 bytes exhausted(错误:已用完允许的 67108864 字节的内存大小)
本文介绍了错误:已用完允许的 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 字节的内存大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

相关文档推荐

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 文件可以吗?)