1、使用ppa增加源
? ? apt-get install python-software-properties
? ??apt-get install software-properties-common
? ? add-apt-repository ppa:ondrej/php
2、更新
? ? apt-get update
3、查看源中PHP7.2版本
?apt list | grep php? ? ? ?列表中已經包含你想要的PHP版本了
4、安裝PHP7.2
?apt-get -y install php7.2
轉載于:https://blog.51cto.com/14124898/2404101