I’ve just tried out the new feature to remove mod_php after being prompted on the dashboard when logging in to Virtualmin 7.0 (Great feature/idea btw).
The output of the script is as follows:
Disabling
Apache mod_php
Removing LoadModule line ..
.. done
Removing php_value directives from virtual servers ..
.. updated 5 servers
Removing global php_value directives ..
.. done
Applying web server configuration ..
.. done
All seems OK and the websites continue working, however after the next restart Apache it fails to start with the following:
May 03 10:43:51 <HOSTNAME> systemd[1]: Reloading The Apache HTTP Server.
May 03 10:43:52 <HOSTNAME> httpd[9110]: AH00526: Syntax error on line 395 of /etc/httpd/conf/httpd.conf:
May 03 10:43:52 <HOSTNAME> httpd[9110]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
May 03 10:43:52 <HOSTNAME> systemd[1]: httpd.service: control process exited, code=exited status=1
May 03 10:43:52 <HOSTNAME> systemd[1]: Reload failed for The Apache HTTP Server.
Upon checking httpd.conf there is indeed still a number of lines such as:
php_admin_value engine Off
php_value memory_limit 32M
For various virtual hosts.
It appears that when the mod_php removal script says it is removing php_value settings, it does not actually do it.
I have tried this on three servers so far, all the same issue.
Manually removing php_* lines form httpd.conf resolves the issue.
I did the manual edit in the httpd.conf by commenting the lines by using the recheck-config to find problem lines, I guess this ok once patch roles out? (I mean no need to uncomment)
I’m relatively new to server management, I did not understand how to apply this patch. (/etc/apache2/sites-available/*.conf on Ubuntu/Debian), do I have to edit each file in the folder or how do I go about this. Thanks.
Yes, you can use Servers ⇾ Apache Webserver: Edit Config Files page to filter and remove all mod_php related directives (all those that start with php_):
Hello,
For this purpose, you need to go o Apache configurations and Delete the php_* directives by editing configurations manually, and after that you able to do this.