memory_limit

Discussion in 'PHP' started by oo7ml, Oct 9, 2007.

  1. #1
    What are the effects of setting a large (php_value memory_limit 16M) in your .htaccess file

    Sometimes i get the follwing error: Allowed memory size of 16777216 bytes exhausted (tried to allocate (some number) bytes) when i try to upload images to my site

    If i increase (php_value memory_limit 16M) memory size in my .htaccess file, what effects will it have on the rest of my site/server
     
    oo7ml, Oct 9, 2007 IP
  2. tamen

    tamen Peon

    Messages:
    182
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It might run out of memory.
     
    tamen, Oct 9, 2007 IP
  3. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Ok, so what can i do to stop this error, my hosting company does not give access to the php.ini file... So what should i do, what should i set the memory_limit to. My users can only upload JPEGs that are less than 2mb in size
     
    oo7ml, Oct 9, 2007 IP
  4. sabmalik

    sabmalik Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think even if you set it in htaccess it wont have effect on your configuration , cause if your provider seems to be restrictive. I would think the best way about this would be to request them to increase the allowed memory size ,you can try and set it to higher number , the effect will be that overall a script would be allowed to use that amount of max ram.
     
    sabmalik, Oct 9, 2007 IP