Upgrade PHP5.1.6 to PHP5.3 in CentOS

5,045

Solution 1

I tried the following Option to update PHP 5.3.4 successfully !!

For CentOS 5.4

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

webtatic RPM Install

rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

PHP Install

yum --enablerepo=webtatic install php

PHP Update

yum --enablerepo=webtatic update php

Solution 2

For CentOS Version 4,

wget http://download.fedora.redhat.com/pub/epel/4/i386/epel-release-4-10.noarch.rpm
wget http://rpms.famillecollet.com/el4.i386/remi-release-4-7.el4.remi.noarch.rpm
rpm -Uvh remi-release-4*.rpm epel-release-4*.rpm

cd /etc/yum.repos.d

wget http://rpms.famillecollet.com/remi-enterprise.repo
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi


yum --enablerepo=remi list php
php.i386 5.3.2-1.el4.remi

yum --enablerepo=remi update php

I upgraded PHP 5.3.4 in two different systems( CentOS 5.4 & 4.7 ) successfully.

Solution 3

By sheer coincidence I have just written this up for another question. I know this seems to be updating mysql, but it should force php to update and avoid a dependency issue. If php doesn't install by the time you have followed all the steps below, yum remove php and then run: yum --enablerepo=remi install php (and anything else you need)

Follow at your own risk etc:

NB: for 64-bit CentOS For 32-bit, leave off the .x86_64 suffixes

yum remove mysql mysql-server
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm'
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm
yum --enablerepo=remi install mysql.x86_64 mysql-server.x86_64 

You might need to tack on any extras you need to the last yum command - eg: php-mysql php-devel php-pdo

Share:
5,045

Related videos on Youtube

gnabhan
Author by

gnabhan

Updated on September 17, 2022

Comments

  • gnabhan
    gnabhan over 1 year

    In my system, have CentOS 5 and PHP 5.1.6. I tried to update php into version up(5.3)

    yum update php
    result: No Packages marked for Update
    

    Anyone have any suggestions? Thanks!

    • David Mackintosh
      David Mackintosh over 13 years
      You might not want to do this. If you bodge 5.3.x and assorted dependancies into C5, you will end up with something which isn't a pure C5 system -- and if it breaks, you get to keep all the pieces. If this is something you think you are going to live with for a while, you might want to use a suitable Fedora to play with while waiting for C6 to come out.
  • drew010
    drew010 about 11 years
    Thanks, this worked for me where some of the others complained about huge lists of missing dependencies such as libc6 etc.
  • Andy
    Andy over 8 years
    Note, Webtatic will be EOLing PHP 5.3 in a few weeks. This answer will no longer be relevant at that point, and stongly suggest PHP 5.5+ is used instead