Click to See Complete Forum and Search --> : Successfully build php4 and apache2


Anon
04-13-2002, 05:58 AM
Compile PHP 4 Apache 2

Qian Ling(qlw8@sina.com), April 13, 2002

There are confilicts between the PHP 4.1 and Apache 2.0.
Many practicers have met with problems when compiling the
two source packages together.
We have also met with problems, and solve them in the
end.
(1) Install php 4.0.6 binary package with Apache 2.0, the
libphp4.so will not work

(2) Compile PHP 4.1.2 with Apache 2.0.35
There are errors when configuring PHP 4.1.2, after I change
the configuration scripts, configuration problems are solved,
but there are many compiling errors.

(3) After searching the internet, I found that there are only
two combination that can install PHP 4 and Apache 2:
(a) PHP 4.1.2 + Apache 2.0.28 beta
(b) PHP 4.2.0 RC + Apache 2.0.35

I only try (a), because I do not find the PHP4.2.0RC
source package on php.net, and CVS server does not work for me.

the compiling options:
(a) For Apache 2.0.28 beta
--prefix=/usr/local/apache --enable-so --enable-usertrack

(b) For PHP 4.1.2
--with-mysql --with-apxs2=/usr/local/apache/bin/apxs
--with-versioning --enable-track-vars

Step1:
compile Apache 2.0.28 beta:
make
make install

Step2:
compile PHP 4.1.2:
make
make install

Step3:
in httpd.conf:
LoadModule php4_module modules/php4lib.so

AddType application/x-httpd-php4 .php .php3

Some practicers claim that we should use
<Files> tag in httpd.conf

Step4:
/usr/local/apache/bin/apachectl configtest
/usr/local/apache/bin/apachectl start
it should OK

-----------------------------------------------------
Hope this document help webmasters and php developers
-----------------------------------------------------