问题描述
我已将 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,我可以使用旧版本激活用户机器。
最佳回答
正如我已经回答了你的问题 Unable to locate package php7.0 并且你已经接受了我的回答,因为你明确要求移除包裹:
sudo apt-get install ppa-purge
sudo ppa-purge ppa:ondrej/php-7.0
次佳回答
删除php7.0使用
sudo apt-get purge php7.0-common
第三种回答
这将删除所有 php7 版本,无论是 php 7.0 还是 php 7.1 等。
sudo apt-get purge php7.*
第四种回答
如果您运行 Abhishek’s,它将删除其他软件包。在我的上它也将删除这些
The following packages will be REMOVED
libapache2-mod-php5.5* libapache2-mod-php5.6* php-common* php-gettext* php-igbinary* php-memcached* php-msgpack* php-pear* php-xdebug* php5-cli*
php5-common* php5-dev* php5-json* php5-memcache* php5-memcached*
php5-readline* php5-redis* php5-xdebug* php5.5-cli* php5.5-common*
php5.5-curl* php5.5-json* php5.5-mysql* php5.5-opcache* php5.5-readline* php5.5-xml* php5.6* php5.6-cli* php5.6-common* php5.6-curl* php5.6-fpm* php5.6-json* php5.6-mbstring* php5.6-mysql* php5.6-opcache* php5.6-readline* php5.6-xml* pkg-php-tools*
所以你最好
sudo apt-get purge php7.*
第五种回答
删除PHP和依赖项的方法是:
apt-get autoremove php7.0
第六种回答
删除 php7.x 简单地使用
sudo apt-get purge `dpkg -l | grep php7.2| awk '{print $2}' |tr "\n" " "`