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.

Cpanel server could be crashed in 10 seg. PHP memory limit

Discussion in 'General Discussion' started by kaesar, Dec 13, 2004.

  1. kaesar

    kaesar Member

    Joined:
    Sep 4, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    Everybody its worried about security issues, but in cpanel/WHM its more dangerous a newbie webmaster , he could crash the server with a simple infinite loop in PHP only.

    I wonder why easyapache in WHM dont compile PHP with --enable-memory-limit option.


    It allows unexperienced webmasters can upload buggy PHP scripts and it eats all memory of server until crash. If the website is popular this will take place in seconds.

    Yesterday one of our clients upload a .php file with an infinite loop , 10 seconds later , all the server resources was wasted and the server hangs up. It was an error of the coder, but it demostrates what vulnerable is the compilation of PHP made by easyapache.

    There is a way of limit this ? , i think this could be avoid with --enable-memory-limit option in PHP compile. How could i add this to easyapache? There are another way to avoid this?

    In my httpd.conf exists this sentences:

    RLimitMEM 204161365
    RLimitCPU 240

    but this wasnt able to avoid the problem.

    I
     
  2. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    Put in an enhancement request @ http://bugzilla.cpanel.net

    Thats the best ( and only offical ) way to get a feature or enhancement added to cpanel.
     
  3. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    Have anybody posted this into Bugzilla?
     
  4. krisdv

    krisdv Well-Known Member

    Joined:
    Jun 18, 2003
    Messages:
    175
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Belgium
    How were you able to identify the php script that caused the problem? I think I might have the same issue.
     
  5. kaesar

    kaesar Member

    Joined:
    Sep 4, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1


    Its dificult , i revised the reciently modified files , and find a file was changed at same time of the hang up.
     
  6. trparky

    trparky Well-Known Member

    Joined:
    Apr 23, 2003
    Messages:
    184
    Likes Received:
    1
    Trophy Points:
    0
    Hate to tell you but that limit is already in PHP.

    Look for...
    max_execution_time = 30
    memory_limit = 8M
    in your PHP.ini file
     
  7. kaesar

    kaesar Member

    Joined:
    Sep 4, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    the setting is in php.ini but dont work if you dont compile with --memory-limit


    you can test it.
     
  8. claven177

    claven177 Well-Known Member

    Joined:
    Sep 3, 2003
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Taipei


    This is old hread, is it correct now?


    I didnot check the box of "--enable-memory-limit option" on easyapache

    I use PHP 4.4.2 and phpsuexec.
     
Loading...

Share This Page