yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
Then edit /etc/httpd/conf/httpd.conf:
vi /etc/httpd/conf/httpd.conf
and change DirectoryIndex to
[…]
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl
[…]
—–
Now configure your system to start Apache at boot time:
chkconfig –levels 235 httpd on
Start Apache:
/etc/init.d/httpd start
—–

12.2 Installing mod_ruby (OPTIONAL)

For CentOS 5.2, there’s no mod_ruby package available, so we must compile it ourselves. First we install some prerequisites:
yum install httpd-devel ruby ruby-devel
Next we download and install mod_ruby as follows:
cd /tmp
wget
tar zxvf mod_ruby-1.2.6.tar.gz
cd mod_ruby-1.2.6/
./configure.rb –with-apr-includes=/usr/include/apr-1
make && make install
Finally we must add the mod_ruby module to the Apache configuration, so we create the file /etc/httpd/conf.d/ruby.conf…
vim /etc/httpd/conf.d/ruby.conf
LoadModule ruby_module modules/mod_ruby.so
… and restart Apache:
/etc/init.d/httpd restart