Unable to remove PHP packages from CentOS, but also unable to update PHP package to PHP 5.3

33,052

Solution 1

Managed to fix the issue.

Using rpm -qa | grep php as suggested by reflexiv would only bring back:

php53-common-5.3.3-1.el5_7.6

As the only installed package. I removed this package, and then installed PHP with the following command:

yum install php53 php53-cli php53-common php53-gd php53-imap php53-intl php53-mbstring php53-mysql php53-odbc php53-pdo php53-pspell php53-snmp php53-xml php53-xmlrpc php-devel

Installing this didn't bring up any errors. I restarted Apache and tested the server with the Symfony2 installation and phpinfo();. Both of them worked and the server is now ready to fly!

Thanks to reflexiv for the help.

Solution 2

To see what PHP packages are installed: rpm -qa | grep php

It looks like you are already using the http://iuscommunity.org repos. They have a nice tool to help upgrade a group of packages like PHP:

yum install yum-plugin-replace
yum replace php --replace-with php53

This will automatically remove all core PHP packages and install the latest from IUS. See http://iuscommunity.org/Docs/ClientUsageGuide#Upgrading_Stock_RHEL_Packages_to_IUS_Packages for more info.

Share:
33,052

Related videos on Youtube

Yogesh Dube
Author by

Yogesh Dube

Updated on September 18, 2022

Comments

  • Yogesh Dube
    Yogesh Dube over 1 year

    I have an interesting, albeit infuriating problem with CentOS.

    I'm trying to configure this server to run a Symfony2 website I've built. The website doesn't work, and I've pinned down the problem to some of the PHP packages on the server being 5.1, and some of the newer packages are PHP 5.3. (Symfony2 requires PHP 5.3 to run).

    I use the following command:

    yum install php53u.x86_64
    

    And I get this error:

    Error: php53-common conflicts with php-common

    Although it does say it's installed.

    Anyway, I go to use yum info php and it tells me that the PHP version installed on the server is still 5.1.6. I go to use yum remove php, thinking if I remove all traces of the old PHP install I can install 5.3 afresh, I get the following error:

    No match for argument PHP.

    What am I doing wrong?

  • Yogesh Dube
    Yogesh Dube about 12 years
    I've got those repo's, and I have tried the yum replace command, but now I get the error - "Error: Package 'php' is not installed". Confusing, as it's obviously installed!
  • reflexiv
    reflexiv about 12 years
    What is the output of rpm -qa | grep php ?
  • Yogesh Dube
    Yogesh Dube about 12 years
    The output is - php53-common-5.3.3-1.el5_7.6. But when I go yum info php it comes back saying the version is 5.1.6?
  • reflexiv
    reflexiv about 12 years
    You sure that is the only output of rpm -qa | grep php ? The core PHP package comes with at least 6 packages.
  • Yogesh Dube
    Yogesh Dube about 12 years
    Also, I'm used yum install php53u.x86_64, which installs but throws up the php-common conflict error. But using the rpm -qa | grep php command still only shows the one php package. I've removed the php53-common and php-common packages, but it reckoned it couldn't find php-common?
  • reflexiv
    reflexiv about 12 years
    You didn't install any RPM packages outside of yum did you? If not, what happens when you do yum clean all; yum remove php53-common php-common ? Also, are you running clamav? I've read it can interfere with yum sometimes.
  • slhck
    slhck about 11 years
    Welcome to Super User, BokaLike. Please familiarize yourself with our formatting tools and check your posts before submitting. Thanks!