(1)更新apt-get源
apt-get update
(2)安装add-apt-repository命令依赖
apt-get install software-properties-common
(3)添加php源
add-apt-repository ppa:ondrej/php
(4)更新apt-get源
apt-get update
(5)安装apache2
apt-get install apache2
(6)安装php7
apt-get install php7.2
(7)启动apache2
/etc/init.d/apache2 start