phpMyAdmin版本:4.9.3
下载程序
wget -c https://files.phpmyadmin.net/phpMyAdmin/4.9.3/phpMyAdmin-4.9.3-all-languages.tar.gz
解压缩到任意位置
tar -zxvf phpMyAdmin-4.9.3-all-languages.tar.gz -C /usr/local/nginx/html
重命名
cd /usr/local/nginx/html/phpMy* phpmyadmin
配置nginx
cd /usr/local/nginx/conf
vim nginx.conf
# 加入以下代码
server {
listen 888; #端口任意指定接口
server_name phpmyadmin.xyz; #写你的域名
root html/phpmyadmin; # phpMyAdmin所在目录
location / {
index index.php index.html index.htm; #默认首页
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
# 这里很重要 没有下边这段一段 无法打开php相关程序
# PHP 脚本请求全部转发到 FastCGI处理. 使用FastCGI协议默认配置.
# Fastcgi服务器和程序(PHP,Python)沟通的协议.
location ~ \.php$ {
# 设置监听端口
fastcgi_pass 127.0.0.1:9000;
# 设置nginx的默认首页文件(上面已经设置过了,可以删除)
fastcgi_index index.php;
# 设置脚本文件请求的路径
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# 引入fastcgi的配置文件
include fastcgi_params;
}
}
做完以上配置 重启nginx
systemctl restart nginx.service