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

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?

3 Answers

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.

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

It looks like you are already using the 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 for more info.

8

The easiest method to update PHP from older version 5.1.x to 5.3.x & the method is called "NASHOT's Method.

  1. Go to GUI mode(X-Windows preferably Gnome desktop) & then "Add/Remove Software section(Package Manager).

  2. Click on Search TAB & enter the search string as php & set the radio button to "Installed Packages" & Hit the Search Button.

  3. Search result will show existing php modules with ticked check-boxes at the beginning. It's something like this:

    [/] php-5.1.x.....
    [/] php-common-5.1.x......
    [/] php-cli-5.1.x......
    [/] php-ldap-5.1.x......
    Etc...Etc...
  4. Now un-tick the checkboxes from all result lines and then click on Apply Button. This will remove existing PHP version modules.

  5. Inside the "Package Manager" click on Search tab & enter the search string as php53. Set the radio button to "All Packages" & Hit Search Button.

  6. Search shows many result lines related to new PHP version 5.3.x with un-ticked checkbox before each line.

  7. Now tick the checkboxes from all resulted lines and then click on the Apply Button.

Now "Package Manager" will begin to check for dependency modules for selected PHP modules and downloads the new PHP 5.3.x package modules. It then installs automatically.

Now restart your system and check the PHP version by using php -v. The result should be PHP 5.3.x.

Please note: If your installation halts at "Checking Dependency", then check for selection of "PHP53-odbc64-5.3.x.....". Actually there are 2 ODBC packages. Each is meant for the 32bit and 64bit version of your OS. So select only one ODBC package which is compatible with your OS.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like