Ubuntu16.04 安装 PHP7.2
2022-07-28 15:20:24
144
{{single.collect_count}}

Ubuntu上官方的源

  • 比如 Ubuntu14.04 默认源中的是 PHP5.6.x、Ubuntu16.04 默认源中的是 PHP7.0.x

通过第三方的源来安装

  • ppa:ondrej/php 是一个比较知名的PHP源(目前维护php5.6,php7.0,php7.1,php7.2,php7.3)。下面就用这个源来安装自己想要的PHP版本。

安装步骤

  • 使用ppa增加源
sudo apt-get install python-software-propertiessudo add-apt-repository ppa:ondrej/phpsudo apt-get update
  • 查看源中PHP7.2版本
sudo apt list | grep php

不出意外,列表中已经包含你想要的PHP版本了

  • 安装PHP7.2
sudo apt-get -y install php7.2
回帖
全部回帖({{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 ? '加载中...' : '查看更多评论'}}