Install PHP 5.2.17 on CentOS 5.10

Another server came with specific hardware that require me to install CentOS 5.10 64 bit with base only package. Since CentOS 5 use PHP 5.1 by default so I decide to find a way for PHP 5.2.17 (latest version of PHP 5.2 generation).

I use Jason package from jasonlitka.com

# nano /etc/yum.repos.d/utter-ramblings.repo

fill these lines :

[utter-ramblings]
name=Utter Ramblings
baseurl=http://yum.jasonlitka.com/EL5/x86_64/
gpgkey=http://yum.jasonlitka.com/RPM-GPG-KEY-jlitka
enabled=1
gpgcheck=1

save.

Make sure to change to http://yum.jasonlitka.com/EL5/i386/ for baseurl if you use 32 bit.

Install PHP and friends

PHP 5.2.17

# yum install php php-mysql

MySQL

# yum install mysql-server

Run as service

# chkconfig httpd --add
# chkconfig  httpd  on --level 235
# chkconfig  mysqld --add
# chkconfig mysqld on --level 235

2  =  Multi-user mode console logins only (without networking)
3  =  Multi-User mode, console logins only
5  = Multi-User mode, with display manager as well as console logins (X11)

Checking if already set as service

# chkconfig --list mysqld
mysqld             0:off    1:off    2:on    3:on    4:off    5:on    6:off
# chkconfig --list httpd
httpd              0:off    1:off    2:on    3:on    4:off    5:on    6:off

Checking installed httpd and mysql :

# rpm -qa | grep httpd
httpd-2.2.22-jason.1

# rpm -qa | grep mysql
mysql-server-5.1.58-jason.1
mysql-5.1.58-jason.1
php-mysql-5.2.17-jason.2
mysqlclient15-5.0.91-1.jason.1

Reboot.

P.S : in case you got error (refused connection) then iptables need to told about this service :

# iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# service iptables save

Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]
Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]