以上是安裝YUM php
#添加幾個(gè)源茫孔,不然會(huì)報(bào)錯(cuò)
#php高版本的yum源地址疯暑,有兩部分竖慧,其中一部分是epel-release,另外一部分來(lái)自webtatic腻惠。如果跳過(guò)epel-release的話,安裝webtatic的時(shí)候
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
#運(yùn)行并查看版本
php74 -v
#重啟命令php-fpm
systemctl restart php74-php-fpm
#添加自動(dòng)啟動(dòng)
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
#如果你運(yùn)行的是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
#重新啟動(dòng)PHP