The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Seem to be unable to set a local php memory_limit for a site :(

Discussion in 'General Discussion' started by isdoo, Sep 20, 2012.

  1. isdoo

    isdoo Active Member

    Joined:
    Mar 25, 2011
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I need to up the memory limit temporarily to 512mb and do not really want to do this for every site on the server.

    But I cannot seem to be able to do this locally.

    I appear to be running for php

    Available handlers: suphp dso cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: dso
    SUEXEC: enabled
    RUID2: not installed

    version 5.2.17

    I tried say ini_set("memory_limit","500M"); in htaccess but that bombed out with a 500 error and an invalid command.

    Anyone have any suggestions?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can increase the memory limit via:

    "WHM >> Service Configuration >> PHP Configuration Editor"

    The "memory_limit" directive on this option will apply to all accounts that do not have a custom value configured.

    Thank you.
     
  3. isdoo

    isdoo Active Member

    Joined:
    Mar 25, 2011
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Appreciate that thanks :)

    However I currently have that set to 512mb and would like to reduce it server wide.

    The problem is, I do not seem able to set the limit locally for one site, so must be doing something wrong or that option is disabled.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Please try adding the following value to the .htaccess file within this account's public_html directory:

    Code:
    php_value memory_limit 64M
    Simply replace "64M" with the value of your choice. This is only applicable with DSO as your PHP handler.

    If you receive an error message, please post the output from the Apache error log.

    Thank you.
     
Loading...

Share This Page