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

  • How to combine .txt ACLs without breaking things
  • How to ping all of Googlebot's IPs script
  • 'virtio0' uses a qcow2 feature which is not supported by this qemu version: QCOW version 3
  • Linux bash script to get the IP of a list of hostnames
  • How To Use Camera Webcam in Docker for OBS Studio etc...
  • Computer Server Won't Post Boot Or Enter BIOS Setup After Installing RAID SAS or GPU Card etc..
  • How To Test PHP Scripts from CLI with GET variables/query string
  • apt-cache how to see all available versions of a package in Debian Ubuntu Mint
  • Virtualbox VBox Guest-utils drag and drop files stops working with Windows VMs
  • How To Remove Ubuntu Netplan and Go Back to /etc/network/interfaces
  • How To Force Flash an AMD Instinct GPU To Another Model Using Debian Ubuntu Mint Linux
  • How To compile ollama from source to use unsupported AMD GPU with rocm in Ubuntu Debian
  • QEMU KVM Virtio GPU Windows Cannot Select 1080P
  • Linux Gnome Desktop Ubuntu Mint Debian Gets Slower After Weeks
  • Firefox How to Save Full Page As Screenshot/PDF
  • Nvidia Datacenter Driver Tesla Slow nvidia-smi response and high utilization with 0 usage
  • ffmpeg how to normalize / increase the volume of your audio
  • kdenlive audio blips pops cracks artifacts solution fix
  • haproxy / nginx certbot SSL issues
  • nginx how to see the real IP when behind a CDN