Centos how to upgrade from PHP 5.2 to 5.3 without downtime

This may sound silly but there will be conflicts/issues with the default Centos repository so you have to use a third party like remi (I prefer not to do this but it's the only option unless you migrate your sites/data to another server or can stand some downtime-not an option IMHO on a production server).

You may need to upgrade to PHP 5.3 to run Joomla or many other reasons.

Your host needs to use PHP 5.2.4 or higher to run this version of Joomla!

yum install php53-* -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.ubiquityservers.com
 * extras: yum.singlehop.com
 * rpmforge: mirror.us.leaseweb.net
 * updates: mirrors.gigenet.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-bcmath.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-cli.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-common.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-dba.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-devel.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-gd.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-imap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-intl.i386 0:5.3.3-13.el5_8 set to be updated
--> Processing Dependency: libicuuc.so.36 for package: php53-intl
--> Processing Dependency: libicudata.so.36 for package: php53-intl
--> Processing Dependency: libicui18n.so.36 for package: php53-intl
--> Processing Dependency: libicuio.so.36 for package: php53-intl
---> Package php53-ldap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-mbstring.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-mysql.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-odbc.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pdo.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pgsql.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-process.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-pspell.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-snmp.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-soap.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-xml.i386 0:5.3.3-13.el5_8 set to be updated
---> Package php53-xmlrpc.i386 0:5.3.3-13.el5_8 set to be updated
--> Running transaction check
---> Package libicu.i386 0:3.6-5.16.1 set to be updated
--> Processing Conflict: php53-common conflicts php-common
--> Finished Dependency Resolution
php53-common-5.3.3-13.el5_8.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
The program package-cleanup is found in the yum-utils package.

As you can see it's not possible to upgrade to 5.3 because it conflicts with the default 5.2 install, there's no common-sense way to upgrade it without fully removing the existing PHP.

So we have to enable remi, a third party repo that will make this work


wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
rpm -ivh remi-release-5.rpm


yum --enablerepo=remi update php php-*



php-readline-5.1.6-15.el5.centos.1.i386 from installed has depsolving problems
  --> Missing Dependency: php-api = 20041225 is needed by package php-readline-5.1.6-15.el5.centos.1.i386 (installed)
php-syck-0.55-4.el5.rf.i386 from installed has depsolving problems
  --> Missing Dependency: php = 5.1.6 is needed by package php-syck-0.55-4.el5.rf.i386 (installed)
Error: Missing Dependency: php = 5.1.6 is needed by package php-syck-0.55-4.el5.rf.i386 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-readline-5.1.6-15.el5.centos.1.i386 (installed)
 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

We run into an issue with php-readline and php-syck and have to remove them to make remi happy.


yum remove php-readline php-syck

Run the install again and it will work.

You may get some weird messages from PHP/MySQL but everything seems to work.


WARNING : This MySQL RPM is not an official Fedora / Red Hat build and it
overrides the official one. Don't file bugs on Fedora Project nor Red Hat.
Use dedicated forums http://forums.famillecollet.com/


PHP Warning:  PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20050922
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysqli.so' - /usr/lib/php/modules/mysqli.so: undefined symbol: php_set_error_handling in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/ncurses.so' - /usr/lib/php/modules/ncurses.so: undefined symbol: first_arg_force_ref in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_declare_long_constant in Unknown on line 0

 

I really do not like this method because it even updates MySQLD in the process for some reason.  Beware that when doing this the newer 5.0 version of MySQL will not let you login with a 16-character+ username this means sites/databases won't work unless you create a user with less characters (this is a weird feature of the new version and is ridiculous in my opinion).  I thought I'd mention it because I spent a lot of time troubleshooting why some databases no longer connected.


Tags:

centos, upgrade, php, downtimethis, conflicts, default, repository, remi, migrate, sites, server, downtime, imho, joomla, yum, install, plugins, fastestmirror, loading, speeds, cached, hostfile, ubiquityservers, extras, singlehop, rpmforge, leaseweb, updates, mirrors, gigenet, resolving, dependencies, transaction, _, updated, bcmath, cli, dba, devel, gd, imap, intl, processing, dependency, libicuuc, libicudata, libicui, libicuio, ldap, mbstring, mysql, odbc, pdo, pgsql, pspell, snmp, xml, xmlrpc, libicu, resolution, depsolving, cleanup, dupes, rpm, va, nofiles, nodigest, utils, removing, existing, enable, repo, wget, http, rpms, famillecollet, enterprise, download, fedoraproject, org, pub, epel, noarch, ivh, enablerepo, update, readline, installed, api, syck, rf, fedora, overrides, dedicated, forums, startup, unable, initialize, module, compiled, dynamic, usr, lib, modules, mysqli, undefined, php_set_error_handling, ncurses, first_arg_force_ref, pdo_mysql, php_pdo_declare_long_constant, method, mysqld, beware, newer, login, username, databases, user, characters, feature, troubleshooting,

Latest Articles

  • CentOS 7 / 8 cannot boot with with mdadm RAID array solution
  • How To Add Default Gateway in Linux using the ip route command routing
  • Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist Solution for Centos8 yum package install error
  • md mdadm array inactive how to start and activate the RAID array
  • Loaded: masked (Reason: Unit hostapd.service is masked.) Solution in Linux Debian Mint Ubuntu
  • Linux Mint Ubuntu Ubiquity Installer Bug EFI Installed To Wrong Partition Solution
  • Libreoffice Impress How To Change The Color of Links
  • ecryptfs How To Backup / Migrate Linux Mint Ubuntu Debian system ecryptfs properly and restore access
  • i915 nouveau Nvidia GPU not starting lightdm Xorg failing solution for Could not determine valid watermarks for inherited state
  • br0: received packet on bond0 with own address as source address Linux Solution Mint Debian Redhat CentOS bridge bridging
  • Debian Mint Ubuntu Howto Disable Network Manager
  • AMD GPU Xorg Won't Start [3576284.324] (EE) Segmentation fault at address 0x0 [3576284.325] (EE) Fatal server error: [3576284.325] (EE) Caught signal 11 (Segmentation fault). Server aborting
  • symbol 'grub_calloc' not found grub boot error solution / fix
  • /var/log/journal huge/too large solution in Debian Mint Ubuntu Linux Howot Fix
  • Libreoffice Calc Opens CSV Spreadsheet File as Asian Language/Chinese Characters Solution Fix
  • RTL8821AU Setup Configure Wifi Realtek 8821 in Linux Debian Mint Ubuntu Howto
  • How To Tell Which Repository a Package Comes From Debian Mint Ubuntu
  • How To Reload All Kernel Modules And List Required Moduels for Each Device - Linux Mint Debian Ubuntu Troubleshooting
  • Debian Ubuntu Mint How To Change Default Display Manager
  • Ubuntu Mint Debian Howto Execute Command / Script / Program Upon Wakeup From Sleep