On Apache 2.4, how can I disable the php7 module?

I want to disable the php7 module.

apache2 -M | grep php 

returns:

php7_module (shared)

However, these commands fail:

a2dismod php7
a2dismod php7_module

They both return a message specifying that the module doesn't exist.

How can I sweet-talk Apache into recognizing that the modules exist, are loaded and running? And then to unload them?


Depends a little on the environment, but try this command or adapt for your filesystem.

ls /etc/apache2/mods-enabled/php*.load

Then use a2dismod with the name shown excluding the .load extension

On my machine would be

a2dismod php7.0