尝试重启时Apache2"configtest failed"

sup*_*mbo 4 .htaccess debian apache2

我试图通过使用.htaccess文件来保护我的www文件夹中的目录,该文件没有任何影响所以我改变了行

    AllowOverride None
Run Code Online (Sandbox Code Playgroud)

在我的apache2.conf中

    AllowOverride All
Run Code Online (Sandbox Code Playgroud)

作为根.

现在我看到这不是正确的方法.当尝试使用重启apache时

    /etc/init.d/apache2 restart (or stop and start)
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

    [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.
Run Code Online (Sandbox Code Playgroud)

我再次将行更改为AllowOverride None,但问题仍然存在.apache2 error.log不包含任何信息.并且配置文件中的第140行是

    IncludeOptional mods-enabled/*.load
Run Code Online (Sandbox Code Playgroud)

因为错误消息表明/ usr/lib/apache2/modules中没有libphp5.so只是libphp5filter.so

sup*_*mbo 20

apt-get install libapache2-mod-php5
Run Code Online (Sandbox Code Playgroud)

刚做完这份工作.现在我不确定apache2.conf的更改是否真的导致了问题...