首先安装一个基本的bsd系统 freebsd 8.1 x86

然后用port方式安装libxml2


下载如下软件:
mysql-5.1.55.tar.gz, httpd-2.2.17.tar.gz, php-5.2.17.tar.bz2

编译安装mysql
   >tar -zxvf mysql-6.0.0-alpha.tar.gz
   >cd mysql-5*
   >./configure --prefix=/usr/local/mysql
   >make
   >make install
   >cp support-files/my-medium.cnf /etc/my.cnf
   >cd /usr/local/mysql
   >chown -R mysql .
   >chgrp -R mysql .
   >bin/mysql_install_db --user=mysql
   >chown -R mysql var
   >bin/mysqld_safe --user=mysql &

   >bin/mysqladmin -u root password 新密码

编译安装httpd
>tar -zxvf httpd-2.2.4.tar.gz
>cd httpd-2.2.4
>./configure --prefix=/usr/local/apache --with-mysql=/usr/local/mysql --enable-module=so --enable-shared=max
>make
>make install


编译安装php
>tar -zxvf php-5.2.2.tar.gz
>cd php-5.2.2
>./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs
>make
>make install
>cp php.ini-dist /usr/local/php/lib/php.ini
>vi /usr/local/php/lib/php.ini

修改 register_globals=On


>vi /usr/local/apache/conf/httpd.conf

找到"AddType application/x-gzip .tgz"(第294行),在它的下面添加
"AddType application/x-httpd-php .php""AddType application/x-httpd-php-source .phps"

找到"DirectoryIndex index.html
"
在index.html 前添加 index.php

 

>vi /usr/local/apache/htdocs/index.php

内容为:
<?php
phpinfo();
?>
>/usr/local/apache/bin/apachectl -k start


09-17 21:25