Adding PHP to Apache on Linux
Building PHP for CGI Use

Ken Coar
Thursday, December 23, 1999 07:46:09 AM
Like Perl, PHP can be used in standalone scripts as well as embedded in Web
pages. Unfortunately, to do both you will need to build it twice:
once for each type of use. (Version 4 of PHP supposedly allows a single build
to provide both the standalone script engine and the Apache module.)
Building the PHP script interpreter is very simple:
% cd ./php/php3/
% rm -f config.status config.cache
% make clean
% ./configure --enable-discard-path other-options
% make
% make install
(Performing the make install step requires
write access to the /usr/local/bin directory, so
you may need to execute it as root.)
The --enable-discard-path switch on the
./configure invocation is necessary to use PHP
scripts as CGI scripts under a Web server, such as in the
cgi-bin directory. To just invoke PHP scripts
directly from shell command lines, you can omit it. Of course, it does no harm
to include it, so you might as well.
Next: Building PHP as an Apache Module »