View Full Version : What "PHP" option to use? Fast-CGI, CGI, Mod-PHP or SuPHP.
edge
2nd April 2009, 11:07
I'm just about ready to install WordPress on my ISPconfig 3 production server for a client, and now I need to know what PHP option is the best to use.
I've tested WordPress on a test server with Fast-CGI, and it looked like all was working fine.
As it's for a client (who has no clue on what he is doing), I was wondering if Fast-CGI is the best option to select?
I've got the following options: Fast-CGI, CGI, Mod-PHP or SuPHP
till
2nd April 2009, 11:42
The php option depends on traffic that you expect for the site and if the site e.g. uploads or creates images or files on the server.
mod_php:
- fast
- runs not under admin user of the site
- well suited for low and high traffic sites, but not for cms systems like joomla.
suphp:
- not so fast
- script runs under web admin
- secure
- well suited for low traffic sites
fastcgi
- fast
- script runs under web admin
- secure
- well suited for high traffic sites
so basicalley the decision is, if a site is low traffic, use suphp. suphp spawns a new cgi process for every page request, but it does not use resources when no pages are requested. On the opposite fastcgi, the php processes are running permanently even if no page is requested, this is faster and fine for a high traffic site but for a small homepage with 100 pageviews per hour you would waste resources.
edge
2nd April 2009, 12:10
Interesting information!
Thank you
edge
2nd April 2009, 12:16
Looks like WordPress does work fine with "mod_php", and as it's not running under admin I will stick with this sertting!
Once again thank you for the info.
Tenaka
30th April 2009, 12:07
ok, very good info so far, but i.e. wordpress, has a built in update module which means the user or the group that the web server runs as needs write access to vertain paths.
which one would I chose now? shall I chose a version where apache runs as the webadmin? I guess that is right? if it is a low traffic site, I shall chose suPhp but do I also have to check the box for suexec or isn't that needed?
till
30th April 2009, 15:39
ok, very good info so far, but i.e. wordpress, has a built in update module which means the user or the group that the web server runs as needs write access to vertain paths.
The wordpress update module can also connect to the site with ftp, so all of them will work.
But you should use either suphp or fastcgi with suexec.
Tenaka
30th April 2009, 17:21
well, if its a site for a client, its easier if he doesn't have to enter any ftp credentials, it jsut confuses people.
besides, if I edit a website, in the optiosn tab I see: Linux User web1
Linux Group client1 - so apache would run when using suPhp as web1 right? but what if the user uploads stuff with his ftp userlogin? which seems to differ from the linux user? I mean the files will be owned by the ftp user then :-(
Tenaka
3rd May 2009, 16:11
ok, now I was looking for a php accelerator and usually I use eaccelerator.
BUT I foudn this statement on their website:
eAccelerator only works with mod_php or php in fastcgi mode. It can't be used in cgi or cli because eAccelerator needs to set up shared memory, and this can only be done when all php instances that need to access it are forks of the first process.
If I read that right, I can only use eaccelerator with mod_php and fastcgi with suexec but NOT with suPhp, right?
Is any of the other accelerators, i.e. x-cache able to work with all three?
Is any of the other accelerators, i.e. x-cache able to work with all three?
No, there is no accelerator that works for cgi based setups like suphp.
Tenaka
3rd May 2009, 19:31
k, thx. found out x-cache in the lenny repository is actually up to date, so I installed that one, changed the config a bit and all seems good...
Tenaka
5th May 2009, 15:03
ok, all the smaller sites, running on suPhp have gone over to the new server very smoothly.
Now I have to move a pretty big one, which needs to run on fastcgi and suexec. What is there to configure or set up? who should own which files? Anything to take especial care about?
What is there to configure or set up?
nothing.
who should own which files?
The administrator / ftp user of the site as you have done it for suphp.
Anything to take especial care about?
no.
The wordpress update module can also connect to the site with ftp, so all of them will work.
But you should use either suphp or fastcgi with suexec.
I read up on why I should use fastcgi on my site and it does make sense. What is the performance difference for enabling suexec? Is enabling it primarily for security? If the only sites on the server are my own, any reason why I still need to enable suexec?
Thanks.
As far as I know, suexec does not makes any performance difference, it is a security function and ensures that the scripts are run under the correct user. Without enabling suexec your scripts will not be able to upload any files to the server directories without making them word writable.
Tenaka
8th May 2009, 21:48
No, there is no accelerator that works for cgi based setups like suphp.
ok, after some testing, I decided to go with eaccelerator again. I jsut noticed that it won't be picked up after editing php.ini and restarting apache...
found this how-to, http://serversupportforum.de/forum/faqs-anleitungen/18518-how-php5-2-3-mit-suphp-eaccelerator-automatische-vhost-conf-f-r-plesk.html and this one http://wiki.dreamhost.com/EAccelerator both suggesting that one switches first to standard cgi mode, kills all fcgi processes then switches back...
isn't there a more elegant method? besides, is that all needed to be done?
Tenaka
9th May 2009, 13:07
I guess its the same problem as with suPhp: accelerators seem not to work with fastcgi AND SUEXEC, right?
any other solutions?
the smal sites I am running with suPhp are fine, but there is this rather big one, running on fastcgi with suexec, that needs a littel bit more power...
if accelerators won't work, what else can one tune?
and btw. tuning the apache.conf file and the php.ini, which one does that influence suPhp, mod_php, fastcgi? Some tuning hints for each of these "modes"?
Tenaka
9th May 2009, 13:51
here is another nice thread, worthwhile reading about these different modes: http://forums.cpanel.net/showthread.php?t=102617
I really think there is a huge speed problem, almost all wordpress sites I am hosting went from 0.2 seconds generation time to close to 0.9 seconds generation time with suPhp and to 0.45 with fastcgi :-(
Tenaka
9th May 2009, 15:18
my mistake, it works actually, I was just laceing the eaccelerator admin script inside another vhosts, so I wasn't able to see anything :-) placeing it into the fastcgi vhost worked ;-) all is well...
Gimly
16th June 2009, 21:39
Hi all,
Is there a way to just proposing fast-cgi and suphp option to our client in ISPC3 and not cgi and mod_php ?
Thanks for your answers
till
16th June 2009, 21:40
Sure, just select it in the client limits ;)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.