1. Login to your server using SSH then create an updated .repo file (you need to be root user to do this)
vi /etc/yum.repos.d/centos-test.repo
2. Paste the following lines in it:
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/5/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
3. Run a yum update:
yum update php
That's it! Your PHP installation should be updated in about 5 seconds! :)
BUT! There are known issues on this, specifically for Zend Optimizer, mcrypt and mhash PHP modules because they are the for the older version of PHP. I fixed the Zend Optimizer issue by re-installing the package itself by yum:
wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
yum install php-zend-optimizer
For the mcrypt and mhash issues, I just installed updated rpm packaged for these:
wget -c ftp://ftp.muug.mb.ca/mirror/centos/5.4/extras/i386/RPMS/php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm
rpm -ivh --nodeps php-mhash-5.2.5-7.i386.rpm
wget -c ftp://ftp.pbone.net/mirror/yum.trixbox.org/centos/5/RPMS/php-mhash-5.2.5-7.i386.rpm
rpm -ivh --nodeps php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm
Let me know if this helps or what issues you came across.
References:
http://www.freshblurbs.com/install-php-5-2-centos-5-2-using-yum
http://www.atomicorp.com/wiki/index.php/PHP
add the end there you put the directions in the wrong order...
ReplyDeleteyou have:
wget mcrypt
rpm mhash
wget mhash
rpm mcrypt
obviously should be:
wget mcrypt
rpm mcrypt
wget mhash
rpm mhash
that aside, thank you for this
Thank you for posting this. It is frustrating to see that GoDaddy is still offering PHP 5.1.6 by default as of April 2010, and moreover, that their own knowledge base doesn't seem to include this particular tip (which I'm sure is not an uncommon issue). And forget about asking this by telephone. I have been meaning to experiment with Magento eCommerce but since it requires PHP 5.2, I haven't been able to, but your steps seem to have done the trick. Thanks!
ReplyDeleteMike, can I chat with you off line about this. I'll pay you for your time or make a donation ;-) using PayPal. No prob there. I have to up date my Godaddy VPS to use PHP 5.2 also and I just want to make sure I don't break any of the site I have hosted on my vd box. Please hit me back today if you can. You can also give me a call (contact info is on my site). Thanks.
ReplyDelete- Alex
Mike, Thanx .. your solution worked fantastic for me...
ReplyDeleteIt seems the mcrypt couldn't found in the mirror mentioned.
ReplyDeleteI have no idea if this is the correct ftps for mcrypt because I've just installed it on my VDS:
ReplyDeletemcrypt
wget -c ftp://ftp.muug.mb.ca/mirror/centos/5.5/extras/i386/RPMS/php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm
Yes, you are right but i don't absolutely agree. I think it's only partial right. But post is god i think.
ReplyDelete