摘要:
编译源代码安装 Apache 1.3.27 和 PHP 4.3.1。
--------------------------------------------------
环境:
FreeBSD 4.7
gcc 2.95.4
--------------------------------------------------
步骤:
1、下载 Apache 1.3.27 源代码
http://www.apache.org/dist/httpd/
2、编译、安装
tar zxf apache_1.3.27.tar.gz
chdir apache_1.3.27
./configure --prefix=/usr/local/apache --enable-module=so
make 1> log 2> log.err &
make install
说明:
--prefix=/usr/local/apache
指定了apache的安装目录
--enable-module=so
启用apache动态模块装入支持
3、测试
/usr/local/apache/bin/apachectl configtest
/usr/local/apache/bin/apachectl start
4、下载 PHP 4.3.1 源代码
http://www.php.net/downloads.php
5、编译、安装
tar jxf php-4.3.1.tar.bz2
chdir php-4.3.1
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
make 1> log 2> log.err &
make install
说明:
--with-mysql
启用mysql支持
--with=apxs=/usr/local/apache/bin/apxs
为apache编译动态模块
7、启用
在/usr/local/apache/conf/httpd.conf中增加如下内容:
<IfModule mod_dir.c>
<IfModule mod_php4.c>
DirectoryIndex index.php index.html
</IfModule>
</IfModule>
然后执行命令:
/usr/local/apache/bin/apachectl restart
--------------------------------------------------
参考资料:
Apache 1.3 documents
http://httpd.apache.org/docs/
PHP 4 documents
http://www.php.net/manual/en/