First update PHP:
# yum -y update php
Then install PHP modules, I use the following ones:
yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
and it is done. Restart apache. Create a page called info.php or whatever you want that ends with .php and put this in it:
<?php
phpinfo();
phpinfo(INFO_MODULES);
?>
save it and access this page from your web browsers, it will show you php config on your server and all php modules installed. If for some reason you get txt output of the file in your browser, your Apache server may not be configured to handle .php files, and in that case edit your httpd.conf (on CentOS 5.3 default location is: /etc/httpd/conf/httpd.conf) and make DirectoryIndex line to look like this:
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
that should take care of most of the file types you’ll use in your web server