Centos8下YUM安装

2020-03-21  本文已影响0人  罐头过期

以上是安装YUM php

#添加几个源,不然会报错
#php高版本的yum源地址,有两部分,其中一部分是epel-release,另外一部分来自webtatic。如果跳过epel-release的话,安装webtatic的时候
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-8.rpm

#更新源
dnf -y install dnf-utils

#安装
yum install php74-php 

#运行并查看版本
php74 -v
#重启命令php-fpm
systemctl restart php74-php-fpm
#添加自动启动
systemctl enable php74-php-fpm
#查看php7.4的安装路径
whereis php
#链接php文件
ln -s /opt/remi/php74/root/usr/bin/php /usr/bin/php

#链接php mysql
 yum -y install php74-php-mysqlnd

#配置文件

# The current PHP memory limit is below the recommended value of 512MB.
vi /etc/opt/remi/php74/php.ini
memory_limit = 512M

#如果你运行的是nginx而不是apache,修改
vi /etc/opt/remi/php74/php-fpm.d/www.conf
user = apache
group = apache
# Replace the values with
user = nginx
group = nginx

#更改PHP目录所有者
chown -R root:nginx /var/opt/remi/php74/lib/php

#重新启动PHP

上一篇下一篇

猜你喜欢

热点阅读