sudo apt install software-properties-common
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
apt update
sudo apt install php5.6 php5.6-fpm php5.6-mysql php5.6-gd php5.6-mbstring php5.6-curl php5.6-soap php5.6-redis php5.6-xml php5.6-apcu php5.6-mcrypt -y
php5.6、自动附送php8。最后一步要下载一堆文件。等半天。