完全卸载PHP,重新安装
2022-07-28 15:20:24
101
{{single.collect_count}}

卸载:(以php7为例)

  1. 删依赖包:
sudo apt-get autoremove php + 你的版本号+*(如:sudo apt-get autoremove php7*)
  1. 删关联:
sudo find /etc -name "*php*" |xargsrm -rf
  1. 清除dept列表里的残留信息:
sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
  1. 检查一下是否卸载干净,如无返回即干净卸载:
dpkg -l | grep php.+你的版本号(如:dpkg -l | grep php.7)

安装 :

  1. 先更新本地内置的程序
sudo apt-get updatesudo apt-get upgrade
  1. 接着,判断系统是否内置了add-apt-repository命令,如果没有执行下列命令安装
sudo apt-get install software-properties-common
  1. 添加最新的PHP源,然后安装(如php7.1)
sudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo apt-get install php7.1 php7.1-common php7.1-fpm php7.1-dev sudo apt-get install php7.1-mbstring php7.1-xml
  1. 安装结束之后就可以执行php -i命令查看到php-cli的信息 。
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}