CentOS 升級 PHP7.2 至 PHP7.4 請用本文依序操作。
> 移除 PHP7.2
sudo systemctl stop php-fpm
sudo yum remove php72w*
sudo mv /etc/yum.repos.d/webtatic* /tmp/
> 安裝 PHP7.4
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
> 修改設定
sudo vi /etc/yum.repos.d/remi-php74.repo
====================================
:
[remi-php74]
:
enabled=1
:
====================================
> 安裝相關套件
sudo yum install composer php php-cli php-common php-curl php-fpm php-gd php-mbstring php-mysqlnd php-process php-snmp php-xml php-zip
> 修改 php.ini
sudo vi /etc/php.ini
====================================
:
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Ho_Chi_Minh
:
====================================
> 修改 php-fpm
sudo vi /etc/php-fpm.d/www.conf
====================================
:
;user = apache
user = nginx
:
;listen.owner = nobody
;listen.group = nobody
;listen.mode = 0660
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
:
====================================
> 啟動 php-fpm
sudo systemctl enable php-fpm
sudo systemctl restart php-fpm
> 修改 nginx 設定
sudo vi /etc/nginx/conf.d/librenms.conf
====================================
:
:
location ~ \.php {
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#fastcgi_pass unix:/var/run/php-fpm/php7.2-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
}
:
====================================
> 重開 nginx
sudo systemctl restart nginx
> 設定 ping 權限
sudo setcap cap_net_raw+ep /usr/sbin/fping
sudo setcap cap_net_raw+ep /usr/sbin/fping6
> 驗證 LibreNMS
./validate.php
./daily.sh
沒有留言:
張貼留言