$ yum install epel-release
$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
$ dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
$ dnf module list php
$ dnf module enable php:remi-7.3 -y
$ yum install php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-xml php-redis php-curl php-pear php-gd php-imagick php-mysqli php-openssl php-fpm php-zip
php扩展包下载地址:https://centos.pkgs.org/
(扩展中的php-devel安装报了错:- nothing provides libedit-devel(x86-64) needed by php-devel-7.3.33-1.el8.re,前往上面网站找到了dnf的安装方式,如下)
$ dnf --enablerepo=powertools install libedit-devel(安装PHP扩展如果报错则运行)
#开启
$ systemctl start php-fpm
#开机启动
$ systemctl enable php-fpm
nginx配置fastcgi_pass 有两种方式1:tcp/ip(即 127.0.0.1:9000) 2:unix:xxx/xxx.sock
nginx->server虚拟主机配置了
1.fastcgi_pass:127.0.0.1(nginx配置文件中设置),然后要前往php-fpm.conf配置 listen=127.0.0.1:9000(我自己新安装的php-fpm配置文件路径是在/etc/php-fpm.conf/www.conf)中