1818IP-服务器技术教程,云服务器评测推荐,服务器系统排错处理,环境搭建,攻击防护等

当前位置:首页 - Linux系统 - ubuntu - 正文

君子好学,自强不息!

ubuntu系统怎么安装php7?

2022-06-30 | ubuntu | 1818ip | 281°c
A+ A-

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-properties
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

查看源中PHP7.2版本

sudo apt list | grep php

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

安装PHP7.2

sudo apt-get -y install php7.2


本文来源:1818IP

本文地址:https://www.1818ip.com/post/1903.html

免责声明:本文由用户上传,如有侵权请联系删除!

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。