gpt4 book ai didi

php - 在 apache2 上启用 php(使用 Ubuntu 16.04)

转载 作者:行者123 更新时间:2023-12-04 18:35:13 25 4
gpt4 key购买 nike

我已经在我的 Ubuntu 16.04.1 系统上安装了 Apache2。

我也想在我的网络服务器上安装和激活 PHP7.0。

我安装了 php 并尝试在 Apache2 中激活该模块。

重新启动服务器时,我得到:

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

当我执行“systemctl status apache2.service”时,我得到:
-- Unit apache2.service has begun starting up.
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: * Starting Apache httpd web server apache2
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: *
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: * The apache2 configtest failed.
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: Output of config test was:
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: [Mon Jan 30 12:19:58.942761 2017] [:crit] [pid 29935:tid 140264661432192] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: AH00013: Pre-configuration failed
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: Action 'configtest' failed.
Jan 30 12:19:58 tom-450-a141ng apache2[29920]: The Apache error log may have more information.
Jan 30 12:19:58 tom-450-a141ng systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 30 12:19:58 tom-450-a141ng systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Jan 30 12:19:58 tom-450-a141ng systemd[1]: apache2.service: Unit entered failed state.
Jan 30 12:19:58 tom-450-a141ng systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 30 12:19:58 tom-450-a141ng sudo[29892]: pam_unix(sudo:session): session closed for user root

所以我不能再启动Apache了。

我到处寻找解决方案。

请帮忙

最佳答案

由于您需要安装 php7,只需删除当前安装的使用 -
sudo apt-get purge php*
然后运行
sudo apt-get -y install php7.0 libapache2-mod-php7.0
然后您可以根据需要安装其他模块 -
apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache
systemctl 重启 apache2

关于php - 在 apache2 上启用 php(使用 Ubuntu 16.04),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41934832/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com