The best way to install PHP is from the source code, as a DSO module. Get it from
Extract the files into the server.
# cd /usr/local/src
# tar xzvf /<download directory>/php-4.1.2.tar.gz
Then create a file with all the configuration options for the source compilation.
# cat > build.sh
./configure --with-apxs=/usr/local/apache/bin/apxs --enable-debug=no --enable-safe-mode --with-mysql=/usr/local/mysql --with-exec-dir=/usr/bin --with-regex=system --with-xml
In most cases the default options will do, but -apxs is essential and --with-mysql will compile support for the MySQL DB into the module.
After that, it's just a case of
# ./build.sh
# make
# make install
Ensure that httpd.conf contains the following lines:
LoadModule php4_module libexec/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php .php4
That should do it (don't forget to restart apache though).
A simple test example:
<!-- HelloWorld.php -->
<html>
<body>
<?php
echo "Hello World -- PHP works!"
?>
</body>
</html> ------------------------------------------------------------------
It's important to think. It's what separates us from lentils.