4-24 3,148 views
1.去phpmyadmin官网下载最新版本
https://www.phpmyadmin.net/downloads/
执行命令:
https://www.phpmyadmin.net/downloads/
执行命令:
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.0/phpMyAdmin-4.7.0-all-languages.tar.gz
tar -xzvf phpMyAdmin-4.7.0-all-languages.tar.gz
mkdir /apps/www/phpmyadmin
cp -r phpMyAdmin-4.7.0-all-languages/* /apps/www/phpmyadmin
2.配置nginx
vim /etc/nginx/conf.d/phpmyadmin.conf
server {
listen 88;
server_name localhost;
index index.html index.htm index.php;
root /home/apps/phpmyadmin;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
index index.php;
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
include fastcgi_params;
}
}
3.配置目录权限,开启端口
chmod -R 0777 /apps/www/phpmyadmin
systemctl restart nginx
vi /etc/sysconfig/iptables
添加保存:-A INPUT -p tcp -m state --state NEW -m tcp --dport 88 -j ACCEPT
systemctl restart iptables