Apache22 + PHP5 + MySQL5.1
环境:FreeBSD 6.1 Release最小化安装+Port+Perl-5.8.8
需要的软件包:通过port安装时要下载这些软件包,为节省时间,其中有些可以从CD安装
假定以下的包放在/usr/ports/distfiles目录下
ZendOptimizer-3.2.2-freebsd6.0-i386.tar.gz
apache22/httpd-2.2.0.tar.bz2
autoconf-2.59.tar.bz2
expat-2.0.0.tar.gz
gettext-0.14.5.tar.gz
gettext-1.05.tar.gz
gnome2
help2man-1.36.3.tar.gz
libtool-1.5.22.tar.gz
m4-1.4.4.tar.bz2
make-3.80.tar.bz2
mysql-5.1.6-alpha.tar.gz
php-5.1.2.tar.bz2
python/python-2.4.2.tar.gz
安装Apache - Version httpd-2.2.0
cd /usr/ports/www/apache22
make install clean
安装PHP5 - Version PHP-5.1.2
cd /usr/ports/lang/php5
make install clean
选中
[x] MULTIBYE Enable zend multibyte support
安装php5-extensions
默认选项中加上
[x] MYSQL MySQL database support
修改httpd.conf
ee /usr/local/etc/apache22/httpd.conf
LoadModule php5_module libexec/apache22/libphp5.so
安装ZendOptimizer - Version - 3.2.2
cd /usr/ports/distfiles
tar zxvf ZendOptimizer-3.2.2-freebsd6.0-i386.tar.gz
cd ZendOptimizer-3.2.2-freebsd6.0-i386
./install.sh
测试一下
重启apache
/usr/local/sbin/apachectl restart
建立测试页
ee /usr/local/www/apache22/data/index.php
内容如下:
echo "This WEB server supports PHP page!";
?>
在浏览器里输入
http://www.test.com/index.php
安装MySQL - Version - MySQL-5.1.6
cd /usr/ports/databases/mysql51-server
make install clean
cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
echo 'mysql_enable="YES"' >> /etc/rc.conf
启动MySQL
设置密码
mysqladmin -u root password ********