Build Ubuntu Server From Scratch – Apache2 Error

Hah, after the 1st error in the 1st post, I got another one. Hey wattaaaa. We won’t become an expert if we don’t find any difficulties right?

So here is the error I got, when the apache2 service won’t start

#sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sab 2020-02-01 15:20:50 WIB; 2min 42s ago
     Docs: https://httpd.apache.org/docs/2.4/

Peb 01 15:20:50 sugi-Satellite-L55-B systemd[1]: Starting The Apache HTTP Server...
Peb 01 15:20:50 sugi-Satellite-L55-B apachectl[7121]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/php7.0.load: Cannot lo
Peb 01 15:20:50 sugi-Satellite-L55-B apachectl[7121]: Action 'start' failed.
Peb 01 15:20:50 sugi-Satellite-L55-B apachectl[7121]: The Apache error log may have more information.
Peb 01 15:20:50 sugi-Satellite-L55-B systemd[1]: apache2.service: Control process exited, code=exited status=1
Peb 01 15:20:50 sugi-Satellite-L55-B systemd[1]: Failed to start The Apache HTTP Server.
Peb 01 15:20:50 sugi-Satellite-L55-B systemd[1]: apache2.service: Unit entered failed state.
Peb 01 15:20:50 sugi-Satellite-L55-B systemd[1]: apache2.service: Failed with result 'exit-code'.

There is a line saying that libphp7.0.so is missing. I got headache trying to get the libphp7.0.so. After reinstalling php and so on. Things that I don’t want to remember, the solution is in this code:

dpkg --get-selections | grep php* // list all php packages installed
sudo apt remove php7.0 // but replace php7.0 with whatever you installed
sudo apt update
sudo apt install php libapache2-mod-php

Here’s the link of the web I read.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.