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

  • Unable to mount location Failed to retrieve share list from server: Connection timed out - Samba/Linux Filesharing Not working Ubuntu Mint Linux Solution
  • How To Resize, Reduce a Video to a Specific Size and Quality Ubuntu Linux using ffmpeg
  • vi how to delete all lines in the file
  • Linux Mint / Ubuntu 20 Intel I219 NIC disconnects
  • Linux can't boot/grub boot loader screen with no options solution
  • EFI PXE grub2 Howto guide for Linux EFI PXE Booting on Debian, Mint, Ubuntu, RHEL
  • Aruba/HP/Dell IAP Wireless Controller Common Default Passwords
  • Debian, Mint Ubuntu how to remove package and associated config files
  • Linux Grub not booting the intended kernel solution in Debian, Mint, Ubuntu how to specify which kernel to boot by default
  • QEMU KVM Keyboard Problems Not Working Right Repeating Characters, Ctrl+C Copy and Paste not working right when using PS2 mouse in guests Solution
  • Linux how to compile binary with static sharedobjects embedded instead of dynamic to use on multi-distributions and avoid glibc compatiblity issues
  • /bin/sh: msgfmt: not found error solution on Linux Compilation Ubuntu Debian Mint Centos
  • Mikrotik RouterOS CHR/ISO Basic and Quick Setup Howto Guide
  • qemu 4 compilation options
  • CentOS 7 8 PXEBoot Netinstall Not Working Solution "Pane is dead "new value non-exisetnt xfs filesystem is not valid as a default fs type"
  • CentOS 6 EOL yum repo won't work Error: Cannot find a valid baseurl for repo: base Solution
  • CentOS 7 8 How To Disable SELinux
  • Wordpress How To Add Featured Image To Post in Hueman Theme
  • kdenlive full reset how to erase all config files
  • CentOS 7 8 yum error Trying other mirror. To address this issue please refer to the below wiki article