confusion in suPHP, suPHPexec and Apache suEXEC

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
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,
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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,
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.
 

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
Thank you so much for the detailed explanation!!
 

thewebhosting

Well-Known Member
May 9, 2008
1,199
1
68
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?
 
Last edited:

StingRay2k01

Active Member
Jun 15, 2003
31
1
158
cPanel Access Level
Root Administrator
Hi,

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

Thanks
Deep
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.
 

nibb

Well-Known Member
Mar 22, 2008
321
5
68
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.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
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?
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.

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?
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.
 

nibb

Well-Known Member
Mar 22, 2008
321
5
68
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.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
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?
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.