我只是按照ondej的PPA按照指南将PHP7添加到服务器中。现在,我想删除旧的php,所以很明显,我这样做了sudo apt-get remove --purge php5
,ti似乎一切正常,除非未卸载。如果可以,php -v
我会得到版本7,但仍然可以php5 -v
得到5.6或php5.6 -v
得到相同的结果。当我这样做sudo apt-get remove php5
(或php5.6)时,我得到的是该软件包尚未安装,但显然是因为我可以执行命令。
x@x-server:~$ php -v
PHP 7.0.6-1+donate.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
x@x-server:~$ php5 -v
PHP 5.6.21-1+donate.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
x@x-server:~$ php5.6 -v
PHP 5.6.21-1+donate.sury.org~trusty+2 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
x@x-server:~$ sudo apt-get remove --purge php5 php5.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php5.6' is not installed, so not removed
Package 'php5' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
x@x-server:~$
如何完全删除php5?
只是因为我知道有人会问-我要删除它,因为我看到有一些我不想拥有的进程正在运行。
1192 root 20 0 358756 30920 23568 S 0.0 2.1 0:00.12 apache2
1238 root 20 0 309316 29708 23448 S 0.0 2.0 0:00.11 php-fpm7.0
1176 root 20 0 166212 17848 14408 S 0.0 1.2 0:00.07 php-fpm5.6
1226 www-data 20 0 359312 15488 7656 S 0.0 1.1 0:00.09 apache2
1227 www-data 20 0 359008 14028 6380 S 0.0 1.0 0:00.00 apache2
1228 www-data 20 0 359008 13496 5856 S 0.0 0.9 0:00.00 apache2
1229 www-data 20 0 358788 9324 1964 S 0.0 0.6 0:00.00 apache2
1230 www-data 20 0 358788 9324 1964 S 0.0 0.6 0:00.00 apache2
1377 www-data 20 0 358788 9324 1964 S 0.0 0.6 0:00.00 apache2
1242 www-data 20 0 309316 8496 2236 S 0.0 0.6 0:00.00 php-fpm7.0
1243 www-data 20 0 309316 8496 2236 S 0.0 0.6 0:00.00 php-fpm7.0
1299 root 20 0 105680 6540 5468 S 0.0 0.4 0:00.06 sshd
1178 www-data 20 0 166212 5580 2140 S 0.0 0.4 0:00.00 php-fpm5.6
1179 www-data 20 0 166212 5580 2140 S 0.0 0.4 0:00.00 php-fpm5.6