安裝apache2+PHP+PHPMYADMIN  

2009年4月23日 星期四 , Posted by 曾easy in

安裝環境: Redhat 9 + mysql-5.1.32-linux-i686-glibc23
MySQL必須先裝好.



★ 下載 httpd-2.0.63.tar.gz

tar zxvf httpd-2.0.63.tar.gz
cd httpd-2.0.63
./configure --enable-so
make
make install

Apache 2.0.63 已安裝在 /usr/local/apache2, configured with loadable module support and the standard MPM prefork.
------------------------------------------------------------------------------------------
下載php-5.2.9.tar.gz

tar zxvf php-5.2.9.tar.gz
cd php-5.2.9
./configure --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --with-openssl=/usr/local/ssl --with-curl=/usr/local/lib
make
make install
cp php.ini-dist /usr/local/lib/php.ini

------------------------------------------------------------------------------------------
★ 編輯 http.conf 加入
LoadModule php5_module modules/libphp5.so (裝php時可能幫我們加了, 再check一下)
編輯 http.conf 加入 (.php, .php2, .php3, .php4, .php5, .php6, and.phtml files to be executed as PHP)

SetHandler application/x-httpd-php

編輯 http.conf ,加入index.php為index
DirectoryIndex index.html index.html.var index.php
大功告成
執行 /usr/local/apache2/bin/apachectl start
------------------------------------------------------------------------------------------
下載phpMyAdmin-3.1.3.2-all-languages.tar.gz

tar zxvf phpMyAdmin-3.1.3.2-all-languages.tar.gz
cd phpMyAdmin-3.1.3.2-all-languages
cp config.sample.inc.php config.inc.php
vi config.inc.php

編輯 config.inc.php時,
$cfg['Servers'][$i]['auth_type'] = 'cookie';
改成 $cfg['Servers'][$i]['auth_type'] = 'http'; (我是透過browser輸入帳號密碼認證)

cd ..
mv phpMyAdmin-3.1.3.2-all-languages /usr/local/apache2/htdocs/phpMyAdmin


然後就可以連http://xx.xx.xx.xx/phpMyAdmin/ 試試我們裝好的 phpMyAdmin了。

This entry was posted on 2009年4月23日 星期四 at 上午9:38 and is filed under . You can follow any responses to this entry through the comments feed .

0 意見

張貼留言