Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I upload a picture

  • File size: 375kb
  • Width: 2000px
  • Height: 3000px

I get an error

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

Why this happen, when 67108864 = 64MB?

I use a shared server. My .htaccess is:

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

</IfModule> 

where must I write php_value memory_limit 128M?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
545 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

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

You can also do it in a bootstrap PHP script.

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

Or even in your .htaccess

php_value memory_limit 128M

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...