Edit httpd.conf.
In the Dynamic Shared Object (DSO) Support section, add
Code:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Find the following, add the php entries:
Code:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.php index.phps
This assumes that you've read the installation instructions for PHP (that tells you how to compile Apache 2 for use with PHP and that you've compiled PHP as per those instructions); just adding the above may not work if Apache was not compiled with the options spelled out in the PHP installation instructions.
Finally, after you've stopped and restarted httpd, you may have to clear your browser's cache before
Code:
<?php
phpinfo();
?>
will display anything (when you do get a display from phpinfo, you're good to go).