Last night, I did the usual apt-get dist-upgrade
on my VPS. Looked fine, until I recently noticed my PHP codes stopped running. Why? Because the Apache installation is screwed up.
$ systemctl status apache2.service
Jan 23 23:47:01 stalingrad systemd[1]: Starting The Apache HTTP Server...
Jan 23 23:47:01 stalingrad apachectl[769249]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php8.1.load>
Jan 23 23:47:01 stalingrad apachectl[769246]: Action 'start' failed.
Jan 23 23:47:01 stalingrad apachectl[769246]: The Apache error log may have more information.
Jan 23 23:47:01 stalingrad systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jan 23 23:47:01 stalingrad systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 23 23:47:01 stalingrad systemd[1]: Failed to start The Apache HTTP Server.
This is line 145-147 of apache2.conf
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
And this is /etc/apache2/mods-enabled/php8.1.load:
# Conflicts: php5
# Depends: mpm_prefork
LoadModule php_module /usr/lib/apache2/modules/libphp8.1.so
My Apache config knowledge is severely limited. How to solve this?