首先輸入下方命令安裝套件
# Install EPEL
yum install -y epel-release
# Update Package
yum update -y
# Install PHP PHP-FPM PHP-mbstring Nginx Redis
yum install -y git php php-fpm php-mbstring nginx redis
接著用Git下載PhpRedisAdmin
# Download PhpRedisAdmin
cd /var/www
git clone https://github.com/ErikDubbelboer/phpRedisAdmin.git
cd phpRedisAdmin
git clone https://github.com/nrk/predis.git vendor
修改Nginx
# 修改Nginx設定
vi /etc/nginx/nginx.conf
server_name localhost;
location / {
root /var/www;
index index.php;
}
location ~ \.php$ {
root /var/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
修改PHP-FPM設定
# 修改PHP-FPM設定
vi /etc/php-fpm.d/www.conf
listen.owner = nobody
listen.group = nobody
listen.mode = 0666
user = nginx
group = nginx
# start php-fpm
systemctl enable php-fpm
systemctl start php-fpm
關閉SELINUX
# disable SELINUX
vi /etc/selinux/config
SELINUX=disabled
新增防火牆規定
# add firewall
firewall-cmd --permanent --zone=public --add-service=http
重啟系統之後就可以在瀏覽器看到PhpRedisAdmin了