Mac install phpmyadmin

Posted by wxianfeng Sat, 10 Sep 2011 17:09:00 GMT

环境:mac ox x lion

发现每次安装phpmyadmin都特别坑爹,windows , ubuntu , centos,mac 都不一样,这次是mac上安装 phpmyadmin,之前的

windows , centos

apache,php 默认是安装的

1,首先 进入 系统偏好设置 -》 共享 -》 web共享 打开

2,查看版本:

localhost:entos wangxianfeng$ /usr/sbin/httpd -v
Server version: Apache/2.2.19 (Unix)
Server built: Jun 16 2011 22:09:54

或者:

wxianfeng:system wangxianfeng$ apachectl -v
Server version: Apache/2.2.19 (Unix)
Server built: Jun 16 2011 22:09:54

查看php版本

>php -v

3,开启apache

sudo apachectl stop | start | restart | status

4,下载phpmyadmin

http://www.phpmyadmin.net/home_page/downloads.php

5,把下载的phpmyadmin 放到自己的某个目录下 ,我的路径

/usr/local/system/phpMyAdmin-3.4.4-all-languages

6,修改phpmyadmin配置

>cd /usr/local/system/phpMyAdmin-3.4.4-all-languages

>cp config.sample.inc.hp config.inc.php

>vim config.inc.php
$cfg['blowfish_secret'] = 'TypeAnything_for_Secure'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$cfg['Servers'][$i]['auth_type'] = 'http';  # 延长登录时间
$cfg['Servers'][$i]['host'] = '127.0.0.1'; # 把localhost 改为 127.0.0.1

7,把phpmyadmin link到webserver上

> cd  /Library/WebServer/Documents
>sudo ln -nfs /usr/local/system/phpMyAdmin-3.4.4-all-languages /Library/WebServer/Documents/phpmyadmin

8,开启apache load php模块

>vim /etc/apache2/httpd.conf
# LoadModule php5_module libexec/apache2/libphp5.so 把注释去掉

9,重启apache

>sudo apachrctl restart

10,访问

http://localhost/phpmyadmin