You are on page 1of 8

29/10/13

www.centos.org

[SOLVED] Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by igorb on 2011/4/9 13:10:02 I've just updated my Linux VPS succesfully from Centos 5.5 to 5.6 An important step for me is to upgrade from PHP 5.1.6 to PHP 5.3 "rpm -q centos-release" returns "centos-release-5-6.el5.centos.1". Looks good! Next step, update PHP using "yum update php", this returned "No packages marked for Update" "Yum list php" returns "php.i386" - "5.1.6-27.el5_5.3". Looks like 5.1.6 is still installed. Ok, try out "yum update php53", this returned "Package(s) php53 available, but not installed". Let's install it then! "yum install php53" returns: --> Running transaction check ---> Package php53.i386 0:5.3.3-1.el5_6.1 set to be updated --> Processing Dependency: php53-cli = 5.3.3-1.el5_6.1 for package: php53 --> Processing Dependency: php53-common = 5.3.3-1.el5_6.1 for package: php53 --> Running transaction check ---> Package php53-cli.i386 0:5.3.3-1.el5_6.1 set to be updated ---> Package php53-common.i386 0:5.3.3-1.el5_6.1 set to be updated --> Processing Conflict: php53-common conflicts php-common --> Finished Dependency Resolution php53-common-5.3.3-1.el5_6.1.i386 from updates has depsolving problems --> php53-common conflicts with php-common Error: php53-common conflicts with php-common You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest Seems like there is a conflict with php-common, probably the already installed PHP 5.1.6. As many folks (and I) want to upgrade to PHP 5.3 in the next few days, I hope we can kickstart this topic with a good procedure for us somewhat less experienced users. Thank you in advance!

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by addw on 2011/4/9 13:41:41 The trouble is that the php53 RPMs provide php53 and NOT php. This causes all sorts of problems. I uninstalled all sorts of stuff, thinking that I could just install again later: php-cli php-pdo php-soap php-mcrypt php-odbc php-common php-ldap php php-gd php-mbstring php-mysql php-xml php-devel php-pear php-pear-db squirrelmail nagios UpdateBrowsCap php-PHlib piranha php-pear-Mail-Mime php-pear-Net-URL php-pear-HTTP-Request php-pearMDB2 php-pear-Log php-pear-Net-Socket nagios-nsca (a couple of those are my own RPMs) I then can't install things like squirrelmail since they need php. This is a CentOS supplied set of packages so it should be easy for them to fix. They need to provide php as well as php53 capabilities. Look at Centos source for php53
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 1/8

29/10/13

www.centos.org

In p h p 5 3 . s p e cthe provides line is: P r o v i d e s :m o d _ p h p=% { v e r s i o n } % { r e l e a s e } But I think that it also needs: P r o v i d e s :p h p=% { v e r s i o n } % { r e l e a s e } Although if they do that then anyone with PHP installed who does y u mu p d a t e might get updated to PHP5.3 automatically -- which they might not want, hmmmmm

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by wolfy on 2011/4/9 13:57:24 Quote: addw wrote: The trouble is that the php53 RPMs provide php53 and NOT php. This causes all sorts of problems. I uninstalled all sorts of stuff, thinking that I could just install again later: php-cli php-pdo php-soap php-mcrypt php-odbc php-common php-ldap php php-gd php-mbstring php-mysql php-xml php-devel php-pear phppear-db squirrelmail nagios UpdateBrowsCap php-PHlib piranha php-pear-Mail-Mime php-pear-Net-URL php-pear-HTTP-Request php-pear-MDB2 php-pear-Log php-pear-Net-Socket nagios-nsca (a couple of those are my own RPMs) I then can't install things like squirrelmail since they need php. This is a CentOS supplied set of packages so it should be easy for them to fix. They need to provide php as well as php53 capabilities.

Feel free to raise your concerns via http://bugzilla.redhat.com . EVERYTHING shipped by the CentOS project in the base and updates repositories respects bug per bug the packages shipped by the upstream commercial vendor. But before doing that, read their release notes first. You can start at http://docs.redhat.com/docs/enUS/Red_Hat_Enterprise_Linux/5/html/5.6_Release_Notes/ar01s04.html

Quote: Where are the centos 5.6 source RPMs ?

As always, they will be made available in the same place as the binaries are, but below the SRPMS directory. They were delayed in order to minimize the impact of the new release on mirrors.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by addw on 2011/4/9 14:14:02 If you look at Redhat bugzilla this has been a high severity bug since 28 January. Given that it has taken that long I suspect that fixing it is harder than we think. I might make myself a small RPM that provides php - that way I will be able to install the other stuff that I need. A bad bodge, but if anyone has a better idea -- please let me know.
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 2/8

29/10/13

www.centos.org

It is more than just pear, but the other packages that depend on php (like some of my own stuff).

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by wolfy on 2011/4/9 14:35:59 Quote: addw wrote: If you look at Redhat bugzilla this has been a high severity bug since 28 January. Given that it has taken that long I suspect that fixing it is harder than we think. I might make myself a small RPM that provides php - that way I will be able to install the other stuff that I need. A bad bodge, but if anyone has a better idea -- please let me know. It is more than just pear, but the other packages that depend on php (like some of my own stuff).

I am pretty sure that ALL packages which depend on php ( via all the variants of Requires: php and/or soname ) will ( or already do ) have issues. First because of the different name and second because php 5.3 is not fully compatible with php 5.1 Assuming that your company policy allows that, rather than creating your own rpm you'd better use the stack provided by the IUS repository.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by addw on 2011/4/9 14:44:13 Quote: php 5.3 is not fully compatible with php 5.1 It is close enough compatible, and any things that did not work could be fixed easily enough. Yes: it is something that we would be happy to do - it be using the latest version of PHP -- there are some nasties in PHP 5.1, but I also need PHPPEAR, yes you do get warnings out of some of pear, but those are mainly due to the change between PHP 4 & PHP 5.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by pschaff on 2011/4/9 14:49:56 Quote: addw wrote: ... I might make myself a small RPM that provides php - that way I will be able to install the other stuff that I need. That won't work as php53 conflicts with php, and because packages such as squirrelmail will not work with php53; can't speak to yours. See CentOS bug #4792: squirrelmail conflicts with php53 . If you need php-5.3 and squirrelmail then waiting for CentOS-6 (or trying SL6) and using the one from EPEL may be the best bet.
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 3/8

29/10/13

www.centos.org

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by addw on 2011/4/9 16:04:10 That is exactly what my RPM would do. It would DEPEND on php53 and PROVIDE php (and prob a coupe of other dependencies and provides). The reason why squirrelmail conflicts is because of a packaging issue, not a technical issue (ie scripting/... issue). There are many more packages than squirrelmail that depend on php -- eg nagios.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by pschaff on 2011/4/10 0:06:54 Quote: addw wrote: That is exactly what my RPM would do. It would DEPEND on php53 and PROVIDE php But php53 conflicts with php. Catch-22.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by igorb on 2011/4/10 19:02:35 Quote: A quote from pschaff from another topic:<br /> Key word "replacement". If you want to replace php with this new and rather incompatible version you must first remove all the old php packages - not recommended unless you need php-5.3.

In my case I really need 5.3 in order to run Magento (ecommerce platform). After some browsing I've found following tutorial. Would this be useful? > service httpd stop Remove previously installed version of PHP: > yum remove php php-* Install PHP 5.3 (looks weird, note the "u" in php53u) > yum install yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp > chkconfig httpd on > service httpd start Anyone here familiar with this approach?

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by Zigzagcom on 2011/4/10 19:28:18 I was researching the same topic for a future upgrade to php53, and from the looks of it, you won't need to append the "u" to
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 4/8

29/10/13

www.centos.org

the package name. I believe the rename was specific to the IUS repo: https://bugs.launchpad.net/ius/+bug/691755 but if you look at the link below, you'll see that the CentOs php53 packages don't have the "u": http://mirror.centos.org/centos/5.6/updates/i386/RPMS/ ...likewise for the x86_64 RPMS So, I think you can ignore the "u" at the cli when upgrading to php53. Maybe someone else can chime in and verify my findings. Incidentally, bind was also upgraded to bind97 and would require a similar approach. Best regards...

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by TrevorH on 2011/4/10 20:18:53 That sounds correct to me. It seems that Redhat haven't done a brilliant job of making php53 a drop-in replacement for the standard php packages since things like Squirrelmail have a "Requires: php >= 4.0.4" and that does not match php53 5.3.3. If they'd made squirrelmail "Require: mod_php" then it would have allowed either to work since both php packages have a "Provides: mod_php" line. That still isn't a complete answer as this particular example also requires php-mbstring and that doesn't work either.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by pschaff on 2011/4/10 22:43:55 The 5.6 squirrelmail will not build against php53 even with the spec file changes to use php53, so it is a bit more complicated than just changing the spec. The SL6 package will build with a one-line change to use php53 but not install due to an unsatisfied requirement for hunspell. The hunspell build fails. Gave up at that stage. The php53u packages are from IUS - wolfy's suggestion; however, they also conflict with php so not sure how that helps. Still seems that waiting for CentOS-6 may be the way to go.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by TrevorH on 2011/4/10 23:44:09 Looks to me more like squirrelmail is just plain broken because it won't rebuild here with php 5.1.6. I get the same symptoms as reported here.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by addw on 2011/4/11 16:49:03 Well, I have a solution. I am not proud of it, but it appears to work. Install http://www.phcomp.co.uk/Downloads/php53-shim-5.3.3-1.2.noarch.rpm What this does is r e q u i r ethe packages: p h p 5 3and p h p 5 3 m b s t r i n gand e x p o r tthe packages: p h pand p h p m b s t r i n g I have now reinstalled nagios (seems to work), and squirrelmail (not tried it yet) and a bunch of my own stuff that got broken is now OK.
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 5/8

29/10/13

www.centos.org

You will prob also need my signing key which is here: http://www.phcomp.co.uk/Software/RPM-GPG-KEY-PHCLCentOS-5 If you want the source RPM get it from http://www.phcomp.co.uk/Downloads/php53-shim-5.3.3-1.2.src.rpm Have fun, enjoy!

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by igorb on 2011/4/12 22:13:14 As far as I can tell the migration from PHP 5.1.6. to PHP 5.3 went pretty well My actions: Stop Apache webserver: > service httpd stop Remove previously installed version of PHP > yum remove php php-* This gave me alot of dependencies with PSA (Plesk) packages. I removed all of them, because I don't use Plesk.

Install PHP 5.3 > yum install php53-pear (not in RPM, not installed) > yum install php53-cli > yum install php53-common > yum install php53-devel (installed together with some dependant packages) > yum install php53-gd > yum install php53-mbstring > yum install php53-mcrypt (not in RPM, not installed) > yum install php53-mhash (not in RPM, not installed, heard it was deprecated) > yum install php53-mysql > yum install php53-soap > yum install php53-pdo (installed together with soap) > yum install php53-xml > yum install php53-xmlrpc > yum install php53-bcmath > yum install php53-pecl-apc (not in RPM, not installed) > yum install php53-pecl-memcache (not in RPM, not installed) > yum install php53-snmp Ofcourse I could have put them in one command, but decided to do them one by one to see what each installation does. Enable Apache webserver (don't really know why this would be an addition to the service httpd start though..) > chkconfig httpd on Start Apache webserver > service httpd start Don't forget! In PHP 5.3 it is required to use the date.timezone setting or the date_default_timezone_set() function. Add date.timezone = "Europe/Amsterdam" (or other zone) to php.ini.

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by pschaff on 2011/4/12 23:54:21 Quote:
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 6/8

29/10/13

www.centos.org

igorb wrote: ... > yum install php53-pear (not in RPM, not installed) That seems to be one of the major complaints about php53. Note that IUS php53u packages provide all you noted missing except -mhash:
A v a i l a b l eP a c k a g e s p h p 5 3 u m c r y p t . i 3 8 6 p h p 5 3 u p e a r . n o a r c h p h p 5 3 u p e c l a p c . i 3 8 6 p h p 5 3 u p e c l m e m c a c h e . i 3 8 6 p h p 5 3 u p e c l m e m c a c h e . i 3 8 6 5 . 3 . 6 1 . i u s . e l 5 1 : 1 . 9 . 2 1 . i u s . e l 5 3 . 1 . 6 4 . i u s . e l 5 3 . 0 . 5 1 . i u s . e l 5 3 . 0 . 6 1 . i u s . e l 5 i u s i u s i u s i u s i u s t e s t i n g

You would probably need to remove the php53 packages and replace them with php53u-* to make use of them. Quote: ... Enable Apache webserver (don't really know why this would be an addition to the service httpd start though..) > chkconfig httpd on The chkconfig command controls what services start and stop at boot and shutdown. If you already had httpd starting that was a do-nothing. Quote: ... Don't forget! In PHP 5.3 it is required to use the date.timezone setting or the date_default_timezone_set() function. Add date.timezone = "Europe/Amsterdam" (or other zone) to php.ini. Good tip. So, can we consider this topic [SOLVED]?

Re: Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3


Posted by igorb on 2011/4/13 20:23:22 In my case this topic is SOLVED. I just upgraded from PHP53 to PHP53u (from IUS) using the following steps. : 1. Download and Install IUS and EPEL package. Check for correct URL: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/ > wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm > wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-1-1.ius.el5.noarch.rpm > rpm -Uvh ius-release*.rpm epel-release*.rpm 2. Stop Apache Webserver: > service httpd stop ---OPTION A: IF YOU HAVE ALL STANDARD PHP PACKAGES INSTALLED, USE:
www.centos.org/modules/newbb/print.php?form=1&topic_id=30881 7/8

29/10/13

www.centos.org

3. Install IUS package for replacing stock packages with IUS: > yum install yum-plugin-replace 4. replace PHP and install IUS PHP53u packages: > yum replace php --replace-with php53u OR OPTION B: OR IF YOU HAVE RHEL 5.6 PHP53 PACKAGES INSTALLED, USE: 3. Remove php53 packages: > yum remove php53 php53-* 4. Install IUS PHP53u packages: > yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-peclmemcache php53u-snmp ---5. Check PHP Version: > php -v 6. Check Apache. Should return: Syntax OK. > httpd -t 7. Start Apache Webserver > service httpd start 8. Add date.timezone = "Europe/Amsterdam" (or other zone) to php.ini and check settings as this is a new PHP.ini.

Re: [SOLVED] Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3
Posted by pschaff on 2011/4/13 20:27:29 Thanks for reporting back, and for being very thorough about it. Marking this thread [SOLVED] for posterity.

Re: [SOLVED] Centos 5.6 - updating from PHP 5.1.6 to PHP 5.3
Posted by amtradm on 2011/4/24 5:02:37 Thanks, the procedures above appear to work. I did encounter 1 message, however, when re/starting the httpd service: [warn] module php5_module is already loaded, skipping I solved this by commenting out the line: LoadModule php5_module modules/libphp5.so in /etc/httpd/conf/httpd.conf per instructions on this website post.

This Post was from: https://www.centos.org/newbb/viewtopic.php?forum=38&topic_id=30881

www.centos.org/modules/newbb/print.php?form=1&topic_id=30881

8/8

You might also like