1.安装源
yum install epel-release yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
2.安装PHP
yum install php74-php-fpm php74-php-gd php74-php-pdo php74-php-mbstring php74-php-cli php74-php-mysqlnd
3.启动PHP
systemctl start php74-php-fpm.service systemctl enable php74-php-fpm.service
4.安装包功能概要
php74-php-fpm PHP管理主程序 php74-php-gd 显示缩略图插件 php74-php-mysqlnd PHP连接mysql插件
5.相关配置项(可选)
vim /etc/opt/remi/php74/php.ini
date.timezone = Asia/Shanghai
vim /etc/opt/remi/php74/php-fpm.d/www.conf
user = nginx
group = nginx
chown -R nginx:nginx /var/opt/remi/php74/
# php-fpm
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}