apache mod_php enabled by default in virtualmin setup


I have noticed a thing: when I install virtualmin on a ubuntu 16.04lts system, it is setup out of the box to use php in fastcgi mode, which is fine.

Why then does it still enable mod-php in apache?


Can you run “apache2ctl -M” or “httpd -M” (depends on OS) and post the results.


Note how fcgid is running. In theory, if I am only using mod_fcgid with php-cgi mode, then mod_php is completely moot. AND (all my sites are php) with no need for mod_php, I certainly don’t need to be running mpm-prefork…

Here you go:

Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
actions_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
dav_module (shared)
dav_svn_module (shared)
authz_svn_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
fcgid_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)
suexec_module (shared)


It sounds like you’re saying you don’t need mod_php?

If not, you can always remove it from the list of available Apache modules, which will prevent Virtualmin from offering it as an option.

To do that, you can run this command:

a2dismod php7.0

And then restart Apache.

You are right, and it worked. Thanks!

hello, Can you confirm for me that a2dismod php7.0, php7.1 or php5.6 would disable mod_php mode… of execution…
Apache restart tends to fails with the error.

AH00526: Syntax error on line 39 of /etc/apache2/sites-enabled/s1.interstellarconsulting.com.conf:
Invalid command ‘php_admin_value’, perhaps misspelled or defined by a module not included in the server configuration
Action ‘configtest’ failed.
The Apache error log may have more information.

so this line needs to be commented …
#php_admin_value engine Off

just want to confirm, before i replace this from all the config files to enitrely disable this on the server… ?

Yes, that is correct. Mod-php will be unloaded.