PHP as Apache module instead of CGI

floopjack

Registered
Aug 29, 2006
2
0
151
Greetings,

It seems that cpanel calls PHP as a CGI instead of Apache module. The problem with this that we're running into is performance -- with about 10 concurrent Horde users, the server (which is dedicated to a single site) slows to a crawl. Looking at process info via top, the problem is with many php processes being spawned from httpd.

So the questions are -- 1) why has PHP been buit this way with cpanel/whm, and 2) how can I have PHP called as a module instead? I see the module is loaded in the httpd.conf, but it's not getting used -- the CGI is instead.

Thanks.
 

sparek-3

Well-Known Member
Aug 10, 2002
1,982
217
343
cPanel Access Level
Root Administrator
The webmail service runs off of its own webserver software. I assume it is Apache, and it may even be the same webserver that CPanel and WHM runs off of. The httpd.conf file in /usr/local/apache/conf/httpd.conf or /etc/httpd/conf/httpd.conf only controls the port 80 regular HTTP webserver. Any changes you make to it will not be reflected by the backend webserver(s).

To my knowledge there is not a way to make adjustments to the backend webservers. If you are having issues with the backend webserver and PHP processes you might consider opening a ticket with CPanel or your license provider. If the mailboxes you are dealing with are quite large, and you are using the mbox mail format, then you might consider switching to maildir which might offer some performance increase.
 

floopjack

Registered
Aug 29, 2006
2
0
151
sparek-3 said:
To my knowledge there is not a way to make adjustments to the backend webservers. If you are having issues with the backend webserver and PHP processes you might consider opening a ticket with CPanel or your license provider. If the mailboxes you are dealing with are quite large, and you are using the mbox mail format, then you might consider switching to maildir which might offer some performance increase.
Yup, it looks like webmail (at least horde+imp) run via cpsrvd instead of httpd. I guess it will be ask CPanel, or maybe set up a standalone apache and php setup on a different port and change the redirect from the standard cpanel webmail ports to others.
 

johny_gjx

Active Member
Apr 15, 2005
42
0
156
Your KeepAlive setting will however affect the number of those processes regardless of that backend. Quick fix (before cPanel helps you) may be to reduce the timeout a little bit. Apache group suggests 5!