首先是apache1.3.27+php4.4.2+mysql5.0.19的静态编译
apache1.3.27+php4.4.2+mysql5.0.19的静态编译
先安装mysql
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf - 与下面一句相似
shell> tar -zxvf mysql5.0.19.tar.gz
shell> cd mysql5.0.19.tar.gz
shell> ./configure --prefix=/usr/local/mysql
shell> make shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
apache第一次编译,并不要安装,因为php的编译需要apache至少已经编译过一次
tar zvxf apache_1.3.27.tar.gz
cd apache_1.3.27
./configure --prefix=/usr/local/apache
编译php
tar zvxf php4.4.2.tar.gz
cd php4.4.2
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-
apache=../apache_1.3.27
make
make install
第二次编译安装apache:
cd ../apache_1.3.27
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a
make
make install
cp ../php4.4.2/php.ini.dist /usr/local/php/lib/php.ini
修改/usr/local/apache/conf/httpd.conf
查找<IfModule mod_mime.c>
在此范围添加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
注意:apache和php的源码包在同一个目录,--with-apache=../apache_1.3.27是指向源码解压的目录
ok!静态编译完成,大家只要启动一下服务器
/usr/local/apache/bin/apachectl start
然后些个php测试页info.php:内容如下
<?php
phpinfo();
?>
正常的话,应该能看到php的信息了,恭喜你静态编译成功!