Update PHP 5.3 to 5.4 in centos

Remove your existing php

#rpm -qa | grep php
//here there shows your old versions like
php_53x86

#yum remove php_53x86

//remove your config files too

#rm -rf /etc/httpd/conf.d/php.conf
#rm -rf /etc/php.ini

Next install SCL  Repository for 5.4 packages

#yum install centos-release-SCL

Then Install PHP 5.4 

#yum install php54 php54-php php54-php-gd php54-php-mbstring

Next you must install the updated database module 

#yum install php54-php-mysqlnd

# yum install php54-php-ldap

# yum install php54-php-imap

# yum install php54-php-snmp

# yum install php54-php-common

Now disable loading the old php 5.3 

#mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php53.off


Finally restart apache

#service httpd restart


find your php.ini file
# find / -name php.ini

if you have any time zone issue then you need to edit date.timezone from php.ini

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone = 

change to

date.timezone = "Asia/Kolkata"

that's all

Post a Comment

0 Comments