I recommend you to install PHP 5.2 through source.
Before you proceed first make sure you have the right packages installed to compile from source. Probably the easiest way to do it as following:
# stop apache
/etc/init.d/httpd stop
# remove PHP 5.3 RPM
yum remove php
# install packages to compile from source
yum groupinstall "Development Tools"
yum install httpd-devel
yum install libxml2-devel
yum install mysql-devel
# download PHP 5.2.13 Source from
www.php.net
# after that extract the tar file:
tar -zxvf php-5.2.13.tar.gz
cd php-5.2.13
./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/local
make
make test (not neccessary)
make install
# hopefully the compilation is succesfully completed
# now copy the default php.ini
cp php.ini-recommended /usr/local/lib/php.ini
# edit php ini
vi /usr/local/lib/php.ini
# change this:
short_open_tag = Off
# to:
short_open_tag = On
# save the document
# edit your Apache http.conf to allow .php files to be parsed
vi /etc/httpd/conf/httpd.conf
# add the following lines:
LoadModule php5_module modules/libphp5.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
# save the document
# restart apache
/etc/init.d/httpd restart
Enjoy PHP 5.2.X!
Kind regards,
Bas van Beek