首頁  >  文章  >  後端開發  >  CentOS yum如何安裝php7.4

CentOS yum如何安裝php7.4

藏色散人
藏色散人轉載
2019-12-04 09:35:1910822瀏覽

centos系統下使用yum安裝php7.4正式版,目前基於WLNMP提供的一鍵安裝套件來安裝

1、新增epel來源

yum install epel-release

2、新增WLNMP一鍵安裝套件來源

rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm

3、安裝php7.4

yum clean all
yum install wphp74

啟動方式

/etc/init.d/php-fpm74 restart

4、設定nginx

(1)如果使用WLNMP提供的nginx,只需要在nginx安裝後取消include enable-php71.conf;取消註解即可

WLNMP安裝nginx方法

yum install wnginx

(2)如果目前使用的是非WLNMP提供的nginx,只需要在nginx中配置以下內容即可

        location ~ [^/]\.php(/|$)
        {
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-fpm74.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

更多相關內容可參考:《PHP7》教學

以上是CentOS yum如何安裝php7.4的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:whsir.com。如有侵權,請聯絡admin@php.cn刪除