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.

RLimit broken for php running with phpsuxec, why?

Discussion in 'General Discussion' started by ozark, Jul 12, 2005.

  1. ozark

    ozark Member

    Joined:
    Sep 14, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I have cpanel boxes which run php with phpsuexec, which means they run php
    in user mode and cgi mode.

    These cgi mode php scripts are started by apache.
    Nevertheless the instruction (in /etc/httpd/conf/httpd.conf)
    RLimitNPROC does NOT limit the amount of php processes a user can have.

    Example: I set: (and of course restarted apache)

    RLimitNPROC 4 8

    but to no avail.
    A user happily had over 30 php scripts (started by apache) running.

    Is phpsuexec not working with RLimit instructions?
    How can this be fixed/worked around?

    Does RLimit and php with phpsuexec work with anyone on a cpanel box?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    IIRC, those parameters only affect apache children and as such will only work when using php through mod_php. Running them as CGI scripts, the processes are limited by the relevant ulimit linux resources. This can be where the WHM > Shell Fork/Bomb protection can help.
     
  3. ozark

    ozark Member

    Joined:
    Sep 14, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for your reply.

    The php processes I am talking about are not started from the command line but
    through a HTTP request.

    pstree -G
    shows the php processes forked off as children from apache processes, just
    like perl cgi scripts which ARE limited by RLimitNPROC.

    Perl and php both run in cgi mode, both run as the domains user forked off of apache processes as children.

    Only difference is that perl uses suexec while php uses phpsuexec.
    The latter mimics a shebang line for the php interpreter, but that can't be causing the problems, right?

    Anyone has this working?
     
  4. ozark

    ozark Member

    Joined:
    Sep 14, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    none has this working?

    rlimit isn't cool and fancy enough for you guys to use or what?
    You do not speak to those who have soiled their hands by typing rlimit?
    Whats up?

    rlimit is old, very very old and dusty but hey!

    It IS useful though!
     
Loading...

Share This Page