05
Nov
2021

Centos 8 安装php8

sudo dnf update

sudo reboot

sudo dnf install -y epel-release

sudo dnf install -y  http://rpms.remirepo.net/enterprise/remi-release-8.rpm

sudo dnf install -y dnf-utils

sudo dnf module reset php

sudo dnf module install -y php:remi-8.0

php -v

dnf install php php-curl php-dom php-exif php-fileinfo php-fpm php-gd php-hash php-json php-mbstring php-mysqli php-openssl php-pcre php-xml libsodium

vi /etc/php-fpm.d/www.conf

将 user = apache 及 group = apache 修改为 user = nginx 及 group = nginx

systemctl start php-fpm

systemctl enable php-fpm

sudo vi /etc/php.ini

修改:

upload_max_filesize = 32M 

post_max_size = 48M 

memory_limit = 256M

systemctl restart php-fpm

Share

You may also like...