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.

Change php limit in shared hosting

Discussion in 'General Discussion' started by ASTRAPI, Oct 30, 2009.

  1. ASTRAPI

    ASTRAPI Well-Known Member

    Joined:
    Jul 8, 2008
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    Hello

    We have a server and we share it using cpanel and in one of the accounts only we want to change the php limit from 32 to 128.

    How can i do it?

    Thank you
     
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    Lol, you mean memory_limit
     
  3. ASTRAPI

    ASTRAPI Well-Known Member

    Joined:
    Jul 8, 2008
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    Yes please :)
     
  4. 9techs

    9techs Member

    Joined:
    Oct 10, 2009
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    locate php.ini
    change memory limit to disired amount
    memory_limit = 32M ;

    and Restart Apache
     
  5. ASTRAPI

    ASTRAPI Well-Known Member

    Joined:
    Jul 8, 2008
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    But this will affect all users...
     
  6. snoie4

    snoie4 Registered

    Joined:
    Aug 2, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Same problem i am facing, can anyone plz tell, what to do? i am not able to do work on Moodle, because of this.. :confused:
     
  7. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    create an .htaccess file and add this line:

    Code:
    php_value memory_limit 32M
     
  8. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    This will only work for .htaccess if the account is using DSO for PHP. If the account is suPHP, FCGI or CGI for the PHP handler, you cannot modify it this way. Since suPHP is the current cPanel default, it stands to reason most newer users will be on suPHP.

    In suPHP, to change the default, you'd want to copy the existing php.ini to the customer's account:

    Code:
    cp /usr/local/lib/php.ini /home/username/public_html/php.ini
    In the copied php.ini in the user's account, change that value to the new one and save it. Then to load that file as the user's php.ini file, put the following into .htaccess:

    Code:
    suPHP_ConfigPath /home/username/public_html/
    Please replace username for each of the above paths to the customer's actual cPanel username. Again, this applies if you are using suPHP for the PHP handler. If you aren't certain which PHP handler is being used, log into WHM then go to Apache Configuration > PHP and SuExec Configuration area to check the PHP handler there.
     
  9. mesranet

    mesranet Well-Known Member

    Joined:
    May 6, 2002
    Messages:
    126
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    I understand that user having their own php.ini on their account, but what gonna happen if the user trying to modify disable_function on php.ini ? Is that will override the original php.ini seting at /usr/local/lib/php,ini ?

    Please help
     
  10. duranduran

    duranduran Well-Known Member

    Joined:
    Apr 30, 2004
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    Hi Miraenda

    If i have PHP5 AND PHP4, it is possible to use 2 diferents suPHP_ConfigPath, one for each PHP.ini versions in diferents paths ?
     
Loading...

Share This Page