[root@localhost ~]# yum update

#添加源
[root@localhost ~]# yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@localhost ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@localhost ~]# rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm 

#单独启用php80源
[root@localhost ~]# yum install yum-utils
[root@localhost ~]# yum-config-manager --disable 'remi-php*'
[root@localhost ~]# yum-config-manager --enable remi-php80

#安装php和php扩展,为应用提供基础

[root@localhost ~]# yum install -y php php-bcmath php-cli php-common php-devel php-fpm php-gd php-intl php-ldap php-mbstring php-mysqlnd php-odbc php-pdo php-pear php-pecl-xmlrpc php-pecl-zip php-process php-snmp php-soap php-sodium php-xml
#启动PHP
[root@localhost ~]# systemctl  start php-fpm
#查看PHP状态
[root@localhost ~]# systemctl  status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2023-12-08 17:14:51 CST; 2 days ago
 Main PID: 7866 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/php-fpm.service
           ├─7866 php-fpm: master process (/etc/php-fpm.conf)
           ├─7867 php-fpm: pool www
           ├─7868 php-fpm: pool www
           ├─7869 php-fpm: pool www
           ├─7870 php-fpm: pool www
           └─7871 php-fpm: pool www

Dec 08 17:14:51 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Dec 08 17:14:51 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
[root@localhost ~]# 
#查看PHP版本
[root@localhost ~]# php -v
PHP 8.0.30 (cli) (built: Aug  3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
[root@localhost ~]# 
#查看PHP安装的功有模块
[root@localhost ~]# php -mod
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib

[Zend Modules]

[root@localhost ~]# 

# PHP配置文件
[root@localhost ~]# find / -name php.ini
/etc/php.ini
[root@localhost ~]# 

[root@localhost ~]# find / -name php.conf
/etc/httpd/conf.d/php.conf
[root@localhost ~]#