centos安装phpmyadmin

1.准备工作:
修改php的配置文件php.ini
session.save_path = “/var/lib/php/session”
添加目录:
mkdir -p /var/lib/php/session
修改目录属主为www
chown www:www /var/lib/php/session -R
2.安装配置phpmyadmin
官方下载页面:http://www.phpmyadmin.net/home_page/downloads.php
(中文用户应该选择下载all-languages版本)
解压
移动到相应的目录位置,并改成容易访问的名称:
mv phpMyAdmin-4.1.12-all-languages /data/apps/phpmyadmin
配置config.inc.php
cp config.sample.inc.php config.inc.php
vim config.inc.php
修改
$cfg['Servers'][$i]['host'] = '127.0.0.1';
3.置Nignx下的站点
server {
 listen 80;
 server_name kl.baidu.com; #填你的
 access_log /data/log/nginx/phpmyadmin_access.log access; #对应你的
 location / {
 root /data/apps/phpmyadmin/phpMyAdmin-4.6.6-all-languages;#对应你的站点目录
 index index.php;
 }
 
 location ~ \.php$ {
 root /data/apps/phpmyadmin/phpMyAdmin-4.6.6-all-languages; #对应你的站点目录
 #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
 fastcgi_pass 127.0.0.1:9999; #配置对应成你的
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 }
 
 location ~ /\.ht {
 deny all;
 }
}

最后重启nginx

 
 
posted @ 2017-03-17 12:10  z寒江雪  阅读(250)  评论(0编辑  收藏  举报