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.

confusion in suPHP, suPHPexec and Apache suEXEC

Discussion in 'EasyApache' started by thewebhosting, May 13, 2009.

  1. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Hello Guys,

    I am bit confuse about modules suPHP, suPHPexec and Apache suEXEC. Can anybody tell me the basic difference between these three?

    Also, what is the difference between PHP handler dso and cgi?

    Thanks,
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    SuExec forces all CGI scripts to run as the user. This can include PHP if PHP is set to run as CGI.

    SuPHP forces all PHP scripts to run as the user (assuming PHP is set to run as SuPHP)

    PHP as an Apache module is DSO. This is the default in a cPanel/WHM environment and results in PHP running as user nobody.

    PHP as CGI will run PHP scripts as if they were CGI scripts. This has several side effects such as the script_name Superglobal variable returning the PHP CGI binary rather than the script.

    cPanel/WHM no longer natively supports phpSuExec, we now use SuPHP instead.
     
  3. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Thank you so much for the detailed explanation!!
     
  4. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    We have installed both the versions of PHP. PHP4 and PHP5. PHP5 is set to default version of PHP.

    PHP 5 Handler - dso
    PHP 4 Handler - cgi

    Can I run both PHP versions as dso or cgi?
     
    #4 thewebhosting, May 14, 2009
    Last edited: May 14, 2009
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You cannot run both as DSO (at least not without some special patching). However you can run both as CGI if you desire.
     
  6. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    Thanks for the information!
     
  7. DeepXP

    DeepXP Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Internet
    cPanel Access Level:
    Root Administrator
    Hi,

    Can anyone tell me disadvantages of running the Apache under suPHP?

    Thanks
    Deep
     
  8. StingRay2k01

    StingRay2k01 Active Member

    Joined:
    Jun 15, 2003
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Speed, speed, speed.
    In other words, it's slow. :)

    However depending on your requirements, you may not notice much of a difference. It just depends how much you need to squeeze out of your server, and the type of content you are serving.
     
  9. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Im sorry to revive this topic but is Apache suExec incompatible with suPHP? I mean, is there something which should not be run besides with suPHP?

    I ask this because on a quad core, Apache with 50 incoming connections almost crashes the server with 50 load, each process, even simple blogs, or simple php scripts take a hell of amount of % CPU.

    I was wondering is this is because of suPHP or something is not normal on my setup. When people say suPHP is slow and that it has a performance hit, of how much are we talking against PHP in DSO mode? 20% slower or 500% slower?

    I really find it hard to believe apache cannot run more then 50 php scripts connections.
     
  10. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Both SuExec (for CGI/Perl scripts) and SuPHP (for PHP scripts) may be used simultaneously without issues, excluding any performance differences between the PHP handler.

    Performance will vary depending on the unique activity and usage on the specific servers involved, including differences in activity of the hosted sites, how resource-intensive some scripts or sites may be, and potential abusive activity that may also be contributing to increased load.

    I would evaluate the load and usage to determine which account or accounts are generating most of the load and decide if administrative action needs to be taken to suspend or disable certain accounts.
     
  11. nibb

    nibb Well-Known Member

    Joined:
    Mar 22, 2008
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Ok thanks. I installed LiteSpeed to do a test. And it seems its PHP that is the problem. Since Litespeed builds the same PHP you had before and the load is somehow reduce but it did not improve.

    That means my PHP build is the problem. About the scripts and sites, I dont think that is possible, they are not custom PHP scripts but pretty standard run on every webhosts, wordpress, phpbb, smf, etc. None of them are high traffic, but the load sometimes just goes crazy and with "top -c" its shows "Php" as taking more resources.

    So LiteSpeed did no helped allot, but at least I know PHP is now the problem. I do have a little suspicious but Easy Apache did not warned me about. When I compiled Apache I use suPHP without memcache or anything else because I was not sure if those are standard, I only selected eAcelerator. So the build runs fine. But I readed somewhere that suPHP doesnt support any kind of caching, that includes eAcelerator. Is this truth?

    That means every PHP is generated from 0 instead of having it cached, which could explain why with so little requests the load gets so high. An Admin told me its MySQL but the strange is that MySQL is not on Top of high cpu usage, its always php proccess, and not a specific one, but from several users.
     
  12. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Using SuPHP allows you to find out which specific users are consuming the most CPU/RAM resources (e.g., while monitoring via "top" for example).

    It is true that eAccelerator has little to no usefulness when used while SuPHP is enabled; for eAccelerator to work you'd need to use either DSO or FastCGI, but with this you would lose out on the security benefits of SuPHP. I would recommend SuPHP for its security benefit over DSO, FastCGI, and eAccelerator.
     
Loading...

Share This Page