centos nginx下安装phpmyadmin

前端之家收集整理的这篇文章主要介绍了centos nginx下安装phpmyadmin前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Nginx下安装PHPmyadmin:

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

安装lnmp:


Nginx配置:

[root@cmlvhost]#cat/etc/Nginx/Nginx.conf
********
includevhost/*.conf;


[root@cmlvhost]#cd/etc/Nginx/vhost/
[root@cmlvhost]#catPHPmyadmin.conf
server{
server_namewww.test.com;
indexindex.htmlindex.htmindex.PHP;
root/home/wwwroot/PHPmyadmin;
location~.*\.(PHP|PHP5)?${
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_indexindex.PHP;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
includefastcgi_params;
includefastcgi.conf;
}
}
[root@cml~]#vim/etc/hosts
122.123.13.13www.test.com


源码包下载

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

[root@cmlvhost]#tar-xvfPHPMyAdmin-4.0.8-all-languages.tar.bz2-C/home/wwwroot
[root@cmlvhost]#cd/home/wwwroot
[root@cmlvhost]#mvPHPMyAdmin-4.0.8-all-languages/PHPmyadmin
[root@cmlvhost]#cdPHPmyadmin
[root@cmlvhost]#cpconfig.sample.inc.PHPconfig.inc.PHP
[root@cmlvhost]#vimconfig.inc.PHP
(修改一下地方)
$i=0;
/*
*Firstserver
*/
$i++;
/*Authenticationtype*/
$cfg['Servers'][$i]['auth_type']='cookie';
/*Serverparameters*/
$cfg['Servers'][$i]['host']='127.0.0.1';##假如MysqL使用其他地址登录的话就修改成其他地址
$cfg['Servers'][$i]['connect_type']='tcp';
$cfg['Servers'][$i]['compress']=false;
/*SelectMysqLifyourserverdoesnothaveMysqLi*/
#$cfg['Servers'][$i]['extension']='MysqLi';
$cfg['Servers'][$i]['AllowNoPassword']=false;


[root@cmlvhost]#/usr/local/Nginx/sbin/Nginx-t
[root@cmlvhost]#/usr/local/Nginx/sbin/Nginx-sreload

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

MysqL>GRANTALLPRIVILEGESON*.*TO'root'@'%'IDENTIFIEDBYPASSWORD'******'


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

原文链接:https://www.f2er.com/centos/374801.html

猜你在找的CentOS相关文章