如何彻底删除 PHP 7?

如何彻底删除 PHP 7?

我已将 PHP 旧版本升级到最新的 php7,但无法启动其服务。

systemctl restart apache2.service

Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details.

状态详细信息:

systemctl status apache2.service


● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Active: failed (Result: exit-code) since Mon 2016-01-04 13:58:17 IST; 5s ago
 Docs: man:systemd-sysv-generator(8)
 Process: 16666 ExecStart=/etc/init.d/apache2 start (code=exited,       status=1/FAILURE)

Jan 04 13:58:17 GCT022 apache2[16666]: *
Jan 04 13:58:17 GCT022 apache2[16666]: * The apache2 configtest failed.
Jan 04 13:58:17 GCT022 apache2[16666]: Output of config test was:
Jan 04 13:58:17 GCT022 apache2[16666]: apache2: Syntax error on line 140 of /etc/apache2...
Jan 04 13:58:17 GCT022 apache2[16666]: Action 'configtest' failed.
Jan 04 13:58:17 GCT022 apache2[16666]: The Apache error log may have more information.
Jan 04 13:58:17 GCT022 systemd[1]: apache2.service: control process exited, code=exit...s=1
Jan 04 13:58:17 GCT022 systemd[1]: Failed to start LSB: Apache2 web server.
Jan 04 13:58:17 GCT022 systemd[1]: Unit apache2.service entered failed state.
Jan 04 13:58:17 GCT022 systemd[1]: apache2.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
root@client022:/home/user22$ ^C

现在我想恢复或删除 php7,以便我可以使用旧版本激活用户机器。

答案1

要删除 php7.0,请使用

sudo apt-get purge php7.0-common

答案2

这将删除所有 php7 版本,无论是 php 7.0 还是 php 7.1 等等。

sudo apt-get purge php7.*

答案3

正如我回答你的问题一样无法找到包 php7.0并且您接受了我的回答,并且因为您明确要求删除该软件包:

sudo apt-get install ppa-purge
sudo ppa-purge ppa:ondrej/php-7.0

答案4

要删除 php7.x,只需使用

sudo apt-get purge `dpkg -l | grep php7.2| awk '{print $2}' |tr "\n" " "`

相关内容