简体   繁体   中英

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

apt-get install libapache2-mod-php5

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM