直接通过yum工具安装PHP,默认php7.2版本,依次执行下面命令
yum install php
yum install php-fpm php-mysqlnd php-pdo php-json php-mbstring php-gd php-xml php-common
systemctl start php-fpm.service //启动php
systemctl enable php-fpm.service//设置开机自启动
systemctl restart httpd //重新启动apache服务