Wednesday, February 23, 2022

[SOLVED] Apache2 "configtest failed" when trying to restart

Issue

i tried to protect a directory in my www-folder by using a .htaccess file which had no effect so i changed line

    AllowOverride None

in my apache2.conf to

    AllowOverride All

as root.

now i see that this wasn't the right way to do it. when trying to restart apache using

    /etc/init.d/apache2 restart (or stop and start)

I'm getting the following error message:

    [FAIL] Starting web server: apache2 failed!
    [warn] The apache2 configtest failed. ... (warning).
    Output of config test was:
    apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on         line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared         object file: No such file or directory
    Action 'configtest' failed.
    The Apache error log may have more information.

I changed the line to AllowOverride None again but the problem remains. The apache2 error.log does not contain any information. And Line 140 in the config file is

    IncludeOptional mods-enabled/*.load

as the error message indicates there is no libphp5.so in /usr/lib/apache2/modules just libphp5filter.so


Solution

apt-get install libapache2-mod-php5

just did the job. Now I'm not sure if the changes apache2.conf actually caused the problem...



Answered By - supersambo
Answer Checked By - Mary Flores (WPSolving Volunteer)