方法:首先使用“sudo apt-get autoremove php7*”命令刪除php的相關包及配置;然后用“sudo find /etc -name "*php*" |xargs rm -rf”命令刪除關聯文件;最后清除dept列表。
本教程操作環境:windows7系統、PHP7.0版,DELL G3電腦
debian/Ubuntu徹底刪除PHP7.0
1、刪除php的相關包及配置
sudo apt-get autoremove php7*
2、刪除關聯
sudo find /etc -name "*php*" |xargs rm -rf
3、清除dept列表
sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "n" " "`
四、檢查是否卸載干凈(無返回就是卸載完成)
dpkg -l | grep php7.0
再次使用 這個命令安裝php
root@greatwall-DF720:/# sudo apt-get install php7.0
推薦學習:《PHP視頻教程》