문제

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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top