安装前准备

1.在安装前需要使用 yum update更新所有软件包。

2.安装epel源

 yum install epel-release

3.安装YUM管理工具

yum install yum-utils

安装PHP

1.安装PHP8.0

 yum install php-gd  php-pdo php-mbstring php-cli php-fpm php-mysqlnd

配置PHP

1.启动、停止、重启PHP及查看PHP状态

#启动fpm
service php-fpm start
#停止fpm
service php-fpm stop
#重启
service php-fpm restart
#查看状态
service php-fpm status

1694419702652.png

2.设置PHP开机启动

#设置开机自启动
systemctl enable php-fpm #取消自启动就用disable
#查看开机启动项
systemctl list-unit-files
systemctl list-unit-files | grep enable