install php on centos8

2020-08-27

编译php太耗精力,不如yum来的快。

1、dnf install dnf-utils
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
rpm -Uvh https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/8/remi/x86_64/remi-release-8.5-3.el8.remi.noarch.rpm

dnf module reset php
#默认设置为remi-8.1版本
dnf module enable php:remi-8.1
yum -y install php php-mysqlnd php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-zip

dnf install http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Error:
Problem: conflicting requests
- nothing provides redhat-release >= 8.6 needed by remi-release-8.6-1.el8.remi.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

2、检查php -v
3、systemctl start php-fpm.service
4、配置Nginx
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9002;
# fastcgi_pass unix://run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}

分类:Linux | 标签: |

相关日志

评论被关闭!