作業系統:FreeBSD 7.2 Release
Apache : 2.2.11
PHP : 5.2.9
MySQL : 5.1.33
一、安裝設定 MySQL51
# cd /usr/ports/database/mysql51-server
# make WITH_XCHARSET=all WITH_CHARSET=utf8 WITH_COLLATION=utf8_general_ci install clean
設定 MySQL 開機自動啟動
編輯 /etc/rc.conf
加入
mysql_enable="YES"
複製設定檔
# cp /usr/local/share/mysql/my-medium.cnf /etc/my.cnf
修改設定檔 /etc/my.cnf
[mysqld]
default-character-set = utf8
[client]
default-character-set = utf8
起動MYSQL
# /usr/local/etc/rc.d/mysql-server start
設定root密碼
# mysqladmin -u root -p password 新密碼
二、安裝設定PHP5
# cd /usr/ports/lang/php5
# make config
# make install clean
# cd /usr/ports/lang/php5-extensions
# make config
# make install clean
複製設定檔
# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
三、安裝設定 Apache22
# cd /usr/ports/www/apache22
# make install clean
設定 APACHE22 開機自動啟動
編輯 /etc/rc.conf
加入
apache22_enable="YES"
修改設定檔
/usr/local/etc/apache22/httpd.conf