edit /opt/apache2/bin/apxs
Replace the top string:
#!/usr/local/bin/perl
with: #!/bin/perl
Then,
change directory to where the PHP source code is. Then, type:
./configure --with-apxs=/opt/apache2/bin/apxs
When that's complete type:
make
Then, when PHP is finished compiling type:
make install
After the installation is complete, edit the file:
/opt/apache2/conf/httpd.conf
You want to then uncomment the line:
AddType application/x-httpd-php .php
Then, when you done all that above, type:
/opt/apache2/bin/apachectl restart
Then, you're in business.
What I typically do is create a small little script called test.php to make sure that PHP is working.
Create a file called test.php and call the phpinfo() function to see if PHP is working.
eg: <?php phpinfo(); ?> Then, execute that script on your server if you get any output.
Hopefully that helps.