Apache 不加载 php 文件

Apache 不加载 php 文件

一切正常,直到我将 php 版本升级到 php5.6。我已经使用 composer 安装了 php5.6。当我重新启动 apache2 服务器并再次启动它时,服务器停止加载 php 文件。请帮忙,httpd.conf文件是空的。我当前的 apache2 版本是Apache/2.2.22(Ubuntu)并且mods-enabled文件夹包含以下文件。

lrwxrwxrwx 1 root root 28 Jun 27 22:25 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root 28 Jun 27 22:25 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root 33 Jun 27 22:25 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root 33 Jun 27 22:25 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root 36 Jun 27 22:25 authz_default.load -> ../mods-available/authz_default.load
lrwxrwxrwx 1 root root 38 Jun 27 22:25 authz_groupfile.load -> ../mods-available/authz_groupfile.load
lrwxrwxrwx 1 root root 33 Jun 27 22:25 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root 33 Jun 27 22:25 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root 32 Jun 27 22:25 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root 32 Jun 27 22:25 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root 27 Jun 27 22:25 cgid.conf -> ../mods-available/cgid.conf
lrwxrwxrwx 1 root root 27 Jun 27 22:25 cgid.load -> ../mods-available/cgid.load
lrwxrwxrwx 1 root root 30 Jun 27 22:25 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root 30 Jun 27 22:25 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root 26 Jun 27 22:25 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root 26 Jun 27 22:25 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root 26 Jun 27 22:25 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root 27 Jun 27 22:25 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root 27 Jun 27 22:25 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root 34 Jun 27 22:25 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root 34 Jun 27 22:25 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root 33 Jun 27 22:25 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root 33 Jun 27 22:25 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root 31 Jun 27 22:25 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root 31 Jun 27 22:25 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root 29 Jun 27 22:25 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root 29 Jun 27 22:25 status.load -> ../mods-available/status.load

答案1

似乎缺少 PHP 的 Apache 模块。使用以下命令安装服务;

sudo apt-get install libapache2-mod-php5

相关内容