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

  • qemu: could not load PC BIOS 'bios-256k.bin' solution
  • Proxmox How To Custom Partition During Install
  • Hyper-V Linux VM Boots to Black Screen, Storage, NIC Not Found Issues
  • Ubuntu Mint How to Fix Missing/Broken /dev and /dev/pts which causes terminal to immediately close exit and not work
  • How high can a Xeon CPU get?
  • bash fix PATH environment variable "command not found" solution
  • Ubuntu Linux Mint Debian Redhat Youtube Cannot Play HD or 4K videos, dropped frames or high CPU usage with Nvidia or AMD Driver
  • hostapd example configuration for high speed AC on 5GHz using WPA2
  • hostapd how to enable and use WPS to connect wireless devices like printers
  • Dell Server Workstation iDRAC Dead after Firmware Update Solution R720, R320, R730
  • Cloned VM/Server/Computer in Linux won't boot and goes to initramfs busybox Solution
  • How To Add Windows 7 8 10 11 to GRUB Boot List Dual Booting
  • How to configure OpenDKIM on Linux with Postfix and setup bind zonefile
  • Debian Ubuntu 10/11/12 Linux how to get tftpd-hpa server setup tutorial
  • efibootmgr: option requires an argument -- 'd' efibootmgr version 15 grub-install.real: error: efibootmgr failed to register the boot entry: Operation not permitted.
  • Apache Error Won't start SSL Cert Issue Solution Unable to configure verify locations for client authentication SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line SSL Library Error: 185090057 error:0B084009:x509 certif
  • Linux Debian Mint Ubuntu Bridge br0 gets random IP
  • redis requirements
  • How to kill a docker swarm
  • docker swarm silly issues