What "PHP" option to use? Fast-CGI, CGI, Mod-PHP or SuPHP.

Discussion in 'General' started by edge, Apr 2, 2009.

  1. edge

    edge Active Member Moderator

    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
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
     
  3. edge

    edge Active Member Moderator

    Interesting information!

    Thank you
     
  4. edge

    edge Active Member Moderator

    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.
     
  5. Ovidiu

    Ovidiu Active Member

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

    till Super Moderator Staff Member ISPConfig Developer

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

    Ovidiu Active Member

    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 :-(
     
  8. Ovidiu

    Ovidiu Active Member

    ok, now I was looking for a php accelerator and usually I use eaccelerator.
    BUT I foudn this statement on their website:

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

    till Super Moderator Staff Member ISPConfig Developer

    No, there is no accelerator that works for cgi based setups like suphp.
     
  10. Ovidiu

    Ovidiu Active Member

    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...
     
  11. Ovidiu

    Ovidiu Active Member

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

    till Super Moderator Staff Member ISPConfig Developer

    nothing.

    The administrator / ftp user of the site as you have done it for suphp.

    no.
     
  13. safoo

    safoo New Member

    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.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
     
  15. Ovidiu

    Ovidiu Active Member

    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/...erator-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?
     
  16. Ovidiu

    Ovidiu Active Member

    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"?
     
  17. Ovidiu

    Ovidiu Active Member

    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 :-(
     
  18. Ovidiu

    Ovidiu Active Member

    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...
     
  19. Gimly

    Gimly Member

    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
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    Sure, just select it in the client limits ;)
     

Share This Page