Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache2 "configtest failed" when trying to restart

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

like image 672
supersambo Avatar asked Nov 29 '22 00:11

supersambo


2 Answers

apt-get install libapache2-mod-php5

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

like image 71
supersambo Avatar answered Dec 04 '22 11:12

supersambo


I know:) that before you wanted add copy of /etc/apache2/sites-available/default. So u have to delete it (ex. site1): sudo a2dissite site1 && sudo a2ensite default

like image 28
user1358444 Avatar answered Dec 04 '22 09:12

user1358444