I recently was having troube getting Apache2 to work with php7.1. I enabled the php module by using sudo a2enmod php7.1 and that worked.
I updated my server using:
sudo apt-get update and then
sudo apt-get upgrade After I had updated my server I restarted it.
my wordpress site was no longer working and it was just displaying the .php page as plain text again.
I assumed it was was the same issue I was having before so I manually tried to re-enable the php7.1 module again using the same command mentioned above (sudo a2enmod php7.1). After running that command I attempted to restart Apache2 with:
sudo service apache2 restart Only to provide me with this error:
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. So of course I run systemctl status apache2.service to try to see what the issue was.
This is was I was provided with:
● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/system/apache2.service.d └─apache2-systemd.conf Active: failed (Result: exit-code) since Mon 2018-06-25 23:54:16 CDT; 7min ago Process: 1163 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE) Jun 25 23:54:16 UndergroundSpecInc systemd[1]: Starting The Apache HTTP Server... Jun 25 23:54:16 UndergroundSpecInc apachectl[1163]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax e Jun 25 23:54:16 UndergroundSpecInc apachectl[1163]: Action 'start' failed. Jun 25 23:54:16 UndergroundSpecInc apachectl[1163]: The Apache error log may have more information. Jun 25 23:54:16 UndergroundSpecInc systemd[1]: apache2.service: Control process exited, code=exited status=1 Jun 25 23:54:16 UndergroundSpecInc systemd[1]: apache2.service: Failed with result 'exit-code'. Jun 25 23:54:16 UndergroundSpecInc systemd[1]: Failed to start The Apache HTTP Server. So to follow the trail I investigate line 146 of /etc/apache2/apache2.conf to find this:
IncludeOptional mods-enabled/*.load At this point I am stuck because I don't see anything wrong with that line.