一、安裝 mysql …… 二、安裝 gnu-pth cd /usr/ports/devel/pth make install clean 三、安裝 Apache2+PHP4+MySQL tar zxvf httpd-2.0.35.tar.gz tar zxvf php-4.2.0RC4.tar.gz cd httpd-2.0.35 ./configure --prefix=/usr/local/apache2 --enable-ext-filter --enable-so make make install cd ../php-4.2.0RC4 ./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-tsrm-pth make make install cp php.ini-dist /usr/local/lib/php.ini 編輯 /usr/local/apache2/conf/httpd.conf 文件,加上如下幾行: SetOutputFilter PHP SetInputFilter PHP 啟動 Apache /usr/local/apache2/bin/apachectl start OK!