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.

PHP memory limit

Discussion in 'EasyApache' started by peter123, Mar 5, 2017.

Tags:
  1. peter123

    peter123 Member

    Joined:
    Apr 14, 2008
    Messages:
    12
    Likes Received:
    1
    Trophy Points:
    51
    Hi,

    Is there any way to set hard limits to PHP settings (such as memory limit and max execution time) so that my customers cannot get over those limits through ini_set function?

    I'm using mod_ruid2 + noshell in new servers, and also suPHP + suEXEC in older servers.

    Thanks!
    Peter
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    542
    Likes Received:
    39
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You have to set php memory limit in server php.ini file and disable Custom PHP.INI so that your all customers use only server php.ini
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  4. peter123

    peter123 Member

    Joined:
    Apr 14, 2008
    Messages:
    12
    Likes Received:
    1
    Trophy Points:
    51
    Thanks for your reply!

    Users seem able to bypass limits in php.ini through ini_set function, such as below. Is there any way to prevent this? I'm thinking to disable ini_set function, but it breaks too many websites.
    ini_set("max_execution_time", "999999");

    Thanks Michael, is there any guide to disable custom php.ini for mod ruid2?

    Regards,
    Peter
     
  5. peter123

    peter123 Member

    Joined:
    Apr 14, 2008
    Messages:
    12
    Likes Received:
    1
    Trophy Points:
    51
    Hi,

    Can anyone please help?
    Is there any way to restrict the ini_set function to change PHP limits (such as max_execution_time) to unlimited or too high?

    Thanks
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page