Help choosing php mode (php-fpm, suphp, mod-php, fast-cgi..)

Discussion in 'General' started by servernewbie, Nov 15, 2013.

  1. servernewbie

    servernewbie New Member

    Hello,

    I just set up ispconfig 3 on a debian 7 server to host some websites.

    I'd need help choosing the php mode (php-fpm, suphp, mod-php, fast-cgi..)
    I've been searching but didn't find a lot of information.

    From what I understand php-fpm would be the newest and fastest option.
    But I also read suphp would be better for low traffic sites (less resources used).

    How about security ? Are all these modes equally secure ?

    Is it ok to run different modes on the same server ? (for example some low traffic sites with suphp and some high traffic sites with php-fpm) or would that use more resources ?

    I understand each mode has it's own php config file, is that right ?

    Thank you for your help.
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    1.) php-fpm and php-fastcgi is both fine (I use fastcgi, but that doesn't mean it is preferable).

    2.) suphp is inside apache so it has both: advantages and disadvantages.
    It might use some less resources and you can control php ini settings via apache directives and htaccess files (i.e. php_value)

    3.) fastcgi/fpm is faster BUT you cannot use php ini settings inside apache directives or htaccess, so if you rely on that - you have to use suphp.

    4.) A website only has its own php.ini if you set custom php.ini settings inside the website options tab. Otherwise the global php.ini is taken. Each mode (php) has its own config file but fastcgi and fpm both should use the one in /etc/php5/cgi (suphp in /etc/php5/apache2/).
     
  3. servernewbie

    servernewbie New Member

    Thank you for your answer.

    Would it be a good idea to use both php-fpm (for high traffic sites) and suphp (for low traffic sites) ? Or would that use up more resources ?

    And from a security perspective, is one option better than the other ?
     
  4. orasis

    orasis Member

    Check this out:
    http://bit51.com/fastcgi-vs-suphp-vs-cgi-vs-mod_php-dso/

    .. it says:
    The truth is I have a dev server which is i386 Pentium 4 and suPHP runs Joomla and WordPress just fine. Joomla is a little heavier.

    .. on the same server I mentioned FastCGI has the same performance as suPHP because this machine does not have much RAM !! I personally choose suPHP because I need different php.ini settings per directory, although if that was not my need I would go with Fast-CGI.

    You can find a lot regarding this topic by a simple Google search. :)
     
    Last edited: Nov 18, 2013

Share This Page