# 解壓至 /usr/local
# groupadd mysql
# useradd -g mysql mysql
# cd mysql
# scripts/mysql_install_db --user=mysql
# chown -R mysql:mysql .
# cp support-files/my-medium.cnf /etc/my.cnf
# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod +x /etc/rc.d/init.d/mysqld
# ln -s /usr/local/mysql/bin/mysql /usr/sbin/mysql
# chkconfig --add mysqld
# service mysqld start
# mysql # 進入驗證
./configure --prefix=/usr/local/apache --enable-module=so
make && make install
cd /usr/local/apache/bin
./apachectl start
# 缺 gcc 請從光碟安裝
./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/lib \
--enable-track-vars \
--with-xml \
--with-mysql=/usr/local/mysql \
--with-mbstring \
--enable-mbstring=all
make && make install
關鍵參數說明:
--with-apxs2:以 Apache DSO 模組編譯
--with-config-file-path:指定 php.ini 目錄
--enable-track-vars:啟用變數追蹤
--with-mysql:指定 MySQL 安裝路徑