Apache Mod_PHP, CGI wrapper, FCGId

I am used to running PHP as Apache Mod_PHP. I recently installed virutalmin on a new machine and see it now defaults to FCGId.

Is there any particular reason for this? What are the security implications if I switch this to run as Apache Mod_PHP?

Are there any performance issues with either selection?

Thanks everyone!


Using mod_php and fcgid provides similar performance.

However, fcgid (and standard CGI, for that matter) comes with the benefit of running each script as the domain owner, rather than running it as the Apache user. That’s considered a pretty big security win.

So, I’d certainly recommend using fcgid or cgi where possible.


Hmm each one of these requires a separate php.ini file. This can be rather resource intensive on my end changing these… I wonder if there is any way to define the symlink to go to /etc/php.ini instead of $HOME/etc/php.5?

Does anyone know if fcgid conflicts with Xcache?

They do indeed use individual php.ini files.

If you find yourself needing to make a change to all the php.ini files on your system, you can use the Virtualmin command line tools to help with that.

You can see a list of options if you run this from the command line:

virtualmin modify-php-ini

Just curious did you check to see which one is actually running php? On my setup when mod_php5 was enabled it was always insisting of running the php scripts rather than letting mod_fcgid handle it. I had to disable the module which also removed the option to even use it. Not a huge loss but I’m curious right now. You should be able to tell in your phpinfo. If you see apache2handler then that is mod_php5 kicking in.