Thursday, March 6, 2008

yum php update to 5.2.4 on plesk

All is going well on my new server at but I wanted the latest php version with soap and json and when I did yum update php it said all was up to date. I settled down for a long day sorting this out but it turned out to be this easy:

wget -q -O - |sh
yum update php
yum install php-soap
yum install php-json
/usr/local/psa/admin/sbin/websrvmng -a
/etc/init.d/httpd reload

Isn't technology great when it work!


Peter said...

Useful post thanks. Was trying to get SOAP going on PHP and this saved a lot of time.

statistics said...

Hey, Awesome post. You saved me that 5 hours for sure!

statistics said...

Yeah, not true. I lost 5 hours anyway because after doing these steps, SOAP worked, but mysql died. Not good. Any ideas? Yum tells me there is nothing to do when I do yum install php-mysql.

steve said...

This worked like a charm. I ran through all of my sites after the update, and everything seems to be running smooth.

Anonymous said...

I'm also trying to update php on my CentOS. When I try yum update php the system reports 'No packages marked for update'. Weird, 'cause I know I don't have the latest version of PHP. Any ideas?

Phoebe Bright said...

Delighted to be of some help!

anonymous, I think this line is the key: wget -q -O - |sh maybe you need a different list of installers for CentOS?

Montoya said...

I don't think you need to install php-json; PHP 5.2 has native JSON support, you should see it enabled when you run phpinfo();

Thanks for the post anyway, I always forget how easy atomicorp makes my life.

Bob said...

Hey! Thanks for documenting this. Really saved me some time too. I owe you a beer or two!

koray bilgi said...

In a situation like @statistics did experienced, try

"mv /etc/php.ini.rpmnew /etc/php.ini"

or locate php.ini.rpmnew and then write it on current php.ini file

And thanks for this useful post..

Phoebe Bright said...

Trying to do yum install mod-python and got this error.

[root@viv ~]# yum install mod-python
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00 [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot open/read repomd.xml file for repository: plesk

However, just ran wget again and all is well!

wget -q -O - |sh

Anonymous said...

thank you veryyy much that worked great, i been looking all over the NET and all of them are confusing :(. this is very simple. thanks a lot.

William Wilson said...

I searched through lots and lots and lots of other blogs and tried tons of stuff, none of it worked. This did. Thanks!

Anonymous said...

It was working fine, until today.
Getting the following error:

yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* atomic:
* base:
* updates:
* addons:
* extras:
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package ntp.i386 0:4.2.2p1-9.el5.centos.2 set to be updated
---> Package audit.i386 0:1.7.7-6.el5_3.3 set to be updated
---> Package sos.noarch 0:1.7-9.16.el5_3.5 set to be updated
---> Package audit-libs-python.i386 0:1.7.7-6.el5_3.3 set to be updated
---> Package pango.i386 0:1.14.9-5.el5.centos set to be updated
filelists.xml.gz | 1.0 MB 00:00
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/", line 145, in main
(result, resultmsgs) = base.buildTransaction()
File "/usr/lib/python2.4/site-packages/yum/", line 647, in buildTransaction
(rescode, restring) = self.resolveDeps()
File "/usr/lib/python2.4/site-packages/yum/", line 704, in resolveDeps
for po, dep in self._checkFileRequires():
File "/usr/lib/python2.4/site-packages/yum/", line 939, in _checkFileRequires
if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename):
File "/usr/lib/python2.4/site-packages/yum/", line 414, in getNewProvides
for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
File "/usr/lib/python2.4/site-packages/yum/", line 300, in getProvides
return self._computeAggregateDictResult("getProvides", name, flags, version)
File "/usr/lib/python2.4/site-packages/yum/", line 470, in _computeAggregateDictResult
sackResult = apply(method, args)
File "/usr/lib/python2.4/site-packages/yum/", line 861, in getProvides
return self._search("provides", name, flags, version)
File "/usr/lib/python2.4/site-packages/yum/", line 43, in newFunc
return func(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/yum/", line 837, in _search
for pkg in self.searchFiles(name, strict=True):
File "/usr/lib/python2.4/site-packages/yum/", line 43, in newFunc
return func(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/yum/", line 586, in searchFiles
self._sql_pkgKey2po(rep, cur, pkgs)
File "/usr/lib/python2.4/site-packages/yum/", line 470, in _sql_pkgKey2po
pkg = self._packageByKey(repo, ob['pkgKey'])
File "/usr/lib/python2.4/site-packages/yum/", line 413, in _packageByKey
po = self.pc(repo, cur.fetchone())
File "/usr/lib/python2.4/site-packages/yum/", line 68, in __init__
File "/usr/lib/python2.4/site-packages/yum/", line 94, in _read_db_obj
setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object

Any clues how to fix it?

Yacov Drori said...

thank you, this post helped me a lot

Anonymous said...

Great! Simple and straight to the point!

XoDaBoss said...

You know, you made this seem so easy! I spent 2 hours just searching for something like this because 1) there's not much documentation on doing this... 2) I knew it really couldn't be that hard.

Thank you sooo much.

Qrupa said...

Thank you, you just saved three days of my life, great post!!!

Helen Pang said...

Anyone know if yum update supported PHP 5.3.2 already?

info said...

I have Plesk 9.5.4 and running Cent OS, any idea what wouold be the right installer?