ubuntu安装php7的方法:首先执行【add-apt-repository ppa:ondrej/php】命令更换php源;然后执行【apt-get -y install php7.2】命令安装php即可。
Ubuntu上官方的源
比如 Ubuntu14.04 默认源中的是 PHP5.6.x、Ubuntu16.04 默认源中的是 PHP7.0.x
(视频教程推荐:linux视频教程)
通过第三方的源来安装
立即学习“PHP免费学习笔记(深入)”;
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
推荐教程:linux教程
以上就是ubuntu怎么安装php7的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号