centos7上安装配置phpmyadmin
运行yum install phpmyadmin可能会报错:"php71w-common conflicts with php-common-5.4.16-48.el7.x86_64".
于是命令指定版本: yum install phpMyAdmin php71w-{json,tidy,process,cli,bcmath}
(这里的71w可以根据具体报错来指定)
创建一个从安装文件到我们的Nginx文档根目录的符号链接:
ln -s /usr/share/phpMyAdmin /usr/share/nginx/html
打开/etc/nginx/nginx.conf, 新增如下内容:
location ~ \.php$ {
root /usr/share/nginx/html/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
location /phpMyAdmin/ {
root /usr/share/nginx/html/;
index index.php;
}
保存退出。
重启服务:
systemctl restart php-fpm
systemctl restart nginx
此时再打开如下地址便可看到phpmyadmin的界面了:http://ip_or_domain/phpMyAdmin