PHP script execution mode

Sorry for disturbing with this general question, but I’m a bit confused.

In Website Options, we can choose between
(1) Apache mod_php (run as Apache’s user)
(2) CGI wrapper (run as virtual server owner)
(3) FCGId (run as virtual server owner)

In the info, it has been written “The former [Apache User] is faster as it means that no additional processes need to be started to execute PHP code”. And in the second paragraph “the FCGId option is the best, as it runs PHP scripts quickly and as the domain owner”.

Which is faster? Option 1 or 3?

On the other hand, the feature ‘Run CGI scripts as domain owner?’ can be disabled only if using the first option. I run as a single user (root), so it suits my needs. Do you recommend shifting to the first option? or FCGId is the best for fast process with less memory usage?

Thanks! :slight_smile:

Howdy,

The CGI and FCGID are the most secure, as they allow you to run scripts via suexec as the domain owner, rather than as the Apache user. So, I’d suggest one of those two.

It’s possible that mod_php is a smidgen faster than FCGID. However, it’s not so big a difference that I’d recommend it, I’d suggest going with the security benefits of FCGID or CGI.

And if you decide you don’t like FCGID, I’d still suggest considering CGI before moving to mod_php.

-Eric

Thanks for your informative reply.I will take your advice not to miss the excellent features of FCCGId :slight_smile:

mod_php might be fast, but you can not use it with Apache’ fast MPM worker mode.