在 Ubuntu 16.04 上安装 php5 和 php7 后 Apache2 无法启动

在 Ubuntu 16.04 上安装 php5 和 php7 后 Apache2 无法启动

我在跑步阿帕奇2php7乌班图16.04。但除此之外,我还安装了php5

  • 安装后php5我执行了sudo a2enmod php5.6

  • 然后我重新启动阿帕奇2sudo service apache2 restart

阿帕奇2不会启动。

运行后systemctl status apache2.service我得到:

    ● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; generated; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
       └─apache2-systemd.conf
  Active: failed (Result: exit-code) since Wed 2016-10-19 20:07:51 BST; 6s ago
  Docs: man:systemd-sysv-generator(8)
  Process: 7656 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS
  Process: 7748 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILU

Oct 19 20:07:51 tulik apache2[7748]:  *
Oct 19 20:07:51 tulik apache2[7748]:  * The apache2 configtest failed.
Oct 19 20:07:51 tulik apache2[7748]: Output of config test was:
Oct 19 20:07:51 tulik apache2[7748]: Segmentation fault (core dumped)
Oct 19 20:07:51 tulik apache2[7748]: Action 'configtest' failed.
Oct 19 20:07:51 tulik apache2[7748]: The Apache error log may have more informat
Oct 19 20:07:51 tulik systemd[1]: apache2.service: Control process exited, code=
Oct 19 20:07:51 tulik systemd[1]: Failed to start LSB: Apache2 web server.
Oct 19 20:07:51 tulik systemd[1]: apache2.service: Unit entered failed state.
Oct 19 20:07:51 tulik systemd[1]: apache2.service: Failed with result 'exit-code

答案1

问题是我没有禁用 php7.0 mod

我跑步sudo a2dimod php7.0,现在一切正常。

现在可以切换版本PHP 容易地。

相关内容