views:

46

answers:

1

When I upload a picture

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

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 shared server if .htaccess

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

</IfModule> 

where I 'll must write php_value memory_limit 128M

+1  A: 

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
alex
thanks for help but why pciture it only have 375kb,
meotimdihia
I can upload 1 picture 2-3MB but only that picture happen error
meotimdihia
@meotimdihia It is the dimensions of the image that are usually the problem. Are you using GD or something on it?
alex
where i can it php_value memory_limit 128M in htaccess, see htaccess of me in post 1
meotimdihia
@meotimdihia Just place it on a new line above the `mod_rewrite` module.
alex
thanks alot for help , i solved this
meotimdihia