You should have Apache installed before trying to install PHP. Here are my Apache installation instructions.
If you want to use PHP with MySQL then you must install MySQL first.
su root
/usr/local/downloadIf you don't already have one, you may need to create that directory now:
mkdir /usr/local/download
cd /usr/local/download ftp ftp.php.net cd pub/distributions bin get php-3.0.12.tar.gz bye
cd /usr/local/download tar xzf php-3.0.12.tar.gz -C ../etc
cd /usr/local/etc ln -s php-3.0.12 php
Compiling PHP
cd php
./configure --with-apache=../httpd --with-config-file-path=/www/conf --enable-track-vars
./configure --with-mysql=/usr/local/mysql --with-config-file-path=/www/conf --with-apache=../httpd --enable-track-vars
Next, jump to step 6.
./configure --help
make
make install
Adding the PHP Module to Apache
cd ../httpd
cat config.status
You can configure Apache using the previous command with the added PHP module by doing:
./config.status --activate-module=src/modules/php3/libphp3.a
If you used the simple Apache install from my instructions the command will look like this:
./configure --prefix=/usr/local/etc/httpd --sysconfdir=/www/conf --activate-module=src/modules/php3/libphp3.a
make
bin/apachectl stop
make install
bin/apachectl start
Setting Up PHP
cd ../php
cp php3.ini-dist /www/conf/php3.ini
cd /www/conf
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
AddType application/x-httpd-php3 .phtml
Check that it Works
cd /usr/local/etc/httpd/bin
./apachectl restart
./apachectl status
Apache Server Status for dev.synop.com
Server Version: Apache/1.3.9 (Unix) PHP/3.0.12
Server Built: Oct 25 1999 00:37:07
...
<?php phpinfo(); ?>
http://dev.synop.com/test.php3