分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

centos nginx下安装phpmyadmin

发布时间:2023-09-06 01:39责任编辑:沈小雨关键词:nginx
nginx下安装phpmyadmin:

因为本人在网上搜索安装phpmyadmin大部分使用Apache安装,而线上机器不想使用Apache,最后找到了nginx下安装的也比较复杂,所以就自己写一篇算了。

安装lnmp:


在nginx配置:

[root@cml vhost]# cat /etc/nginx/nginx.conf********    include vhost/*.conf;


[root@cml vhost]# cd /etc/nginx/vhost/[root@cml vhost]# cat phpmyadmin.confserver{        server_name www.test.com;        index index.html index.htm index.php;        root /home/wwwroot/phpmyadmin;        location ~ .*\.(php|php5)?$ {                fastcgi_pass  unix:/tmp/php-cgi.sock;                fastcgi_index index.php;                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;                include fastcgi_params;                include fastcgi.conf;        }}
[root@cml ~]# vim /etc/hosts122.123.13.13  www.test.com


源码包下载

在官网http://www.phpmyadmin.net/下载phpMyAdmin源码包phpMyAdmin-4.0.10.20-all-languages.tar

[root@cml vhost]# tar -xvf phpMyAdmin-4.0.8-all-languages.tar.bz2 -C /home/wwwroot[root@cml vhost]# cd /home/wwwroot[root@cml vhost]# mv phpMyAdmin-4.0.8-all-languages/ phpmyadmin[root@cml vhost]# cd phpmyadmin[root@cml vhost]# cp config.sample.inc.php config.inc.php[root@cml vhost]# vim config.inc.php(修改一下地方)$i = 0;/* * First server */$i++;/* Authentication type */$cfg['Servers'][$i]['auth_type'] = 'cookie';/* Server parameters */$cfg['Servers'][$i]['host'] = '127.0.0.1';    ##假如mysql使用其他地址登录的话就修改成其他地址$cfg['Servers'][$i]['connect_type'] = 'tcp';$cfg['Servers'][$i]['compress'] = false;/* Select mysql if your server does not have mysqli */#$cfg['Servers'][$i]['extension'] = 'mysqli';$cfg['Servers'][$i]['AllowNoPassword'] = false;


[root@cml vhost]# /usr/local/nginx/sbin/nginx -t[root@cml vhost]# /usr/local/nginx/sbin/nginx -s reload

假如mysql没密码,我建议还是加上密码:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '******'


访问:http://www.test.com


centos nginx下安装phpmyadmin

原文地址:http://blog.51cto.com/legehappy/2064539

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved