Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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|improve this answer
    
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! –  mickburkejnr Mar 5 '12 at 20:56
    
What is the output of rpm -qa | grep php ? –  reflexiv Mar 5 '12 at 20:58
    
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? –  mickburkejnr Mar 5 '12 at 21:03
    
You sure that is the only output of rpm -qa | grep php ? The core PHP package comes with at least 6 packages. –  reflexiv Mar 5 '12 at 21:07
    
Yes definitely. Letter for letter that's what I've typed in, and that's all I get. That one record. –  mickburkejnr Mar 5 '12 at 21:09
up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
Welcome to Super User, BokaLike. Please familiarize yourself with our formatting tools and check your posts before submitting. Thanks! –  slhck Feb 12 '13 at 20:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.