apache mod_php enabled by default in virtualmin setup

7 posts / 0 new
Last post
#1 Fri, 02/10/2017 - 15:59
Jason at eROI

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?


Fri, 02/10/2017 - 18:40
Diabolico's picture

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

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Fri, 02/10/2017 - 19:01
Jason at eROI


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)
Fri, 02/10/2017 - 20:54


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.

Fri, 02/24/2017 - 08:38
Jason at eROI

You are right, and it worked. Thanks!

Sat, 01/06/2018 - 14:04

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

Best Regards, Rohit

Sat, 01/06/2018 - 15:21
Jason at eROI

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

Topic locked