天天看點

phpMyAdmin4.4.7安裝及配置

環境說明:

系統版本:centos 6.6 32bit   

軟體版本:mysql 5.6.25 、nginx1.6.2 、 php5.4.37 LNMP架構

說明:mysql5.5版本以上需要使用phpmyadmin4.4版本以上;

步驟如下:

# unzip phpMyAdmin-4.4.7-all-languages.zip 

# mv phpMyAdmin-4.4.7-all-languages/* /usr/local/nginx/html/phpmyadmin/

# cd /usr/local/nginx/html/phpmyadmin/

# cp config.sample.inc.php config.inc.php 

浏覽器通路 192.168.20.5/phpmyadmin

使用root使用者,密碼為mysql密碼登入;

<a href="http://s3.51cto.com/wyfs02/M01/72/B3/wKioL1Xr3C-ju6GAAADqcyMdA2E414.jpg" target="_blank"></a>

報錯如下圖:無法登入MySQL伺服器;

出現這個錯誤,表示沒有連接配接到資料庫

解決方法:

# vi config.inc.php 

找到這一行    $cfg['Servers'][$i]['host'] = 'localhost';

修改為:$cfg['Servers'][$i]['host'] = '127.0.0.1';

重新連接配接就登入進去了;

<a href="http://s3.51cto.com/wyfs02/M02/72/B3/wKioL1Xr3LjjcbJ9AARFhfOkeXI316.jpg" target="_blank"></a>

nginx虛拟主機配置如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

<code># cat /usr/local/nginx/conf/vhosts/default.conf </code>

<code>server</code>

<code>{</code>

<code>    </code><code>listen 80;</code>

<code>    </code><code>server_name 192.168.20.5;</code>

<code>    </code><code>index index.html index.htm index.php;</code>

<code>    </code><code>root </code><code>/usr/local/nginx/html</code><code>;</code>

<code>    </code> 

<code>    </code><code>location ~ \.php$ {</code>

<code>    </code><code>include fastcgi_params;</code>

<code>    </code><code>fastcgi_pass unix:</code><code>/tmp/php-fcgi</code><code>.sock;</code>

<code>    </code><code>fastcgi_index index.php;</code>

<code>    </code><code>fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;</code>

<code>    </code><code>}</code>

<code>}</code>

php-fpm配置如下:

16

<code># cat /usr/local/php/etc/php-fpm.conf</code>

<code>[global]</code>

<code>pid = </code><code>/usr/local/php/var/run/php-fpm</code><code>.pid</code>

<code>error_log = </code><code>/usr/local/php/var/log/php-fpm</code><code>.log</code>

<code>[www]</code>

<code>user = php-fpm</code>

<code>group = php-fpm</code>

<code>listen = </code><code>/tmp/php-fcgi</code><code>.sock</code>

<code>listen.mode = 0666</code>

<code>pm = dynamic</code>

<code>pm.max_children = 50</code>

<code>pm.start_servers = 20</code>

<code>pm.min_spare_servers = 5</code>

<code>pm.max_spare_servers = 35</code>

<code>pm.max_requests = 500</code>

<code>rlimit_files = 1024</code>

<b></b>

<b>本文轉自 模範生 51CTO部落格,原文連結:http://blog.51cto.com/mofansheng/1691895,如需轉載請自行聯系原作者</b>