Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have to install PHP 5.3 on my CentOS server. If I do yum install php, the base repository installs 5.1.6 which is too old for the applications I need to install. So I've been trying to use the IUS repository, following the official instructions from IUS:

root@linuxbox ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1-2.ius.el5.noarch.rpm

root@linuxbox ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm

root@linuxbox ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm

OK. Now I simply do yum install php53, etc. for all I need... but I get this error:

Running rpm_check_debug
Running Transaction Test
Finished Transaction Test


Transaction Check Error:
  file /usr/bin/php from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
  file /usr/bin/php-cgi from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
  file /usr/share/man/man1/php.1.gz from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
  file /etc/php.ini from install of php53u-common-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-common-5.1.6-27.el5_5.3.x86_64

Error Summary
-------------

I have no idea on how to solve this. I think I have to delete the base packages. However, as someone new to Linux, I don't know how to do that.

share|improve this question
add comment

8 Answers

up vote 9 down vote accepted

Update: Apparently RHEL 5.6 includes PHP 5.3, so this will be showing up natively for CentOS soon.

file /usr/bin/php from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
file /usr/bin/php-cgi from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
file /usr/share/man/man1/php.1.gz from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
file /etc/php.ini from install of php53u-common-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-common-5.1.6-27.el5_5.3.x86_64

The problem here is that the packages you are installing have a different name (php53 instead of php), but they attempt to install the same files...hence the conflicts. This isn't necessarily the best way to put the packages together, but I don't know if there are better packages available so we'll ignore that.

To remove your currently installed packages:

# yum remove php-cli php-common php

So, in general, yum remove <list of packages> will remove the packages. And of course, yum list installed to see a list of installed packages (or rpm -qa).

share|improve this answer
    
hm yeah remove might be better than erase, since erase also removes dependencies. Try the remove first, if that fails try erase. –  Phil Hollenback Jan 11 '11 at 20:07
2  
remove and erase are synonymns, according to the yum man page under both CentOS and recent Fedora releases. –  larsks Jan 11 '11 at 20:08
    
Thanks! That worked, although i didn't have to remove php but the first two in that list. To install php 5.3 i only need to yum install php53 right? There are alot of packages listed but i think that's the only important one right? –  fivelitresofsoda Jan 11 '11 at 20:11
    
Definitely synonyms. Look in yumcommands.py if you doubt. :) –  mattdm Jan 11 '11 at 20:11
    
Probably. Only you would know if your application requires any of the additional modules (e.g., xml support, ldap support, databases, and so forth). –  larsks Jan 11 '11 at 20:12
show 1 more comment

I have just solved this problem after much research, namely installing PHP 5.3.10 on CentOS 5.3. I had tried using several repositories, including the Atomicorp repo, but this broke plesk

I finally found the following steps works a treat, thought I share.

BEGIN

Download and enable REMI and EPEL repositories

cd ~
wget http://dl.fedoraproject.org/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 epel-release-5*.rpm

vi /etc/yum.repos.d/remi.repo

Change "enabled=0" to "enabled=1" under the "[remi]" heading

You must remove php-sqlite2 or you will get a dependency error

yum remove php-sqlite2

Update PHP to the latest version 5.3.10 in this case

yum update php

Back up php.ini and enable newly-installed version

mv /etc/php.ini /etc/php.ini.old
mv /etc/php.ini.rpmnew /etc/php.ini

Back up my.cnf and enable newly-installed version

mv /etc/my.cnf /etc/my.cnf.old
mv /etc/my.cnf.rpmnew /etc/my.cnf

Install latest version of ioncube extension

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar -xvf ioncube_loaders_lin_x86-64.tar.gz
mv ioncube/* /usr/lib64/php/modules/

echo 'zend_extension=/usr/lib64/php/modules/ioncube_loader_lin_5.3.so' > /etc/php.d/ioncube-loader.ini

You may also need to install php extensions, in this case I also needed to install the SOAP extension:

yum install php-soap

Restart services to make the changes take affect

service mysqld restart
service httpd restart

DONE

Cheers; Mark

share|improve this answer
add comment
  1. I had to remove php-cli, php-common and php-dev along with some dependencies but nothing else (MySQL, etc. were untouched.)
  2. I installed the same packages in the PHP 5.3 flavor with dependencies and now everything is up and running. phpinfo confirms that I'm running PHP Version 5.3.3.
  3. I restarted Apache and the site, running Joomla, just works fine.
share|improve this answer
add comment

The answer to this has changed, as of January 13th, 2011. Red Hat has released version 5.6, and this includes PHP version 5.3 as a separate package (php53).

You have to remove the old PHP and then install PHP 5.3 separately. This sounds similar to your package from the IUS repository, but now it's official.

For more information, see the Red Hat release notes.

Note that this is just out from Red Hat, and there will be a little delay before this is available in CentOS. The RHEL 5.6 update looks relatively minor, though, so I shouldn't expect it to be too long.

share|improve this answer
    
yep. and 4 months later. it's still not in centos repos. :( –  Stann Mar 31 '11 at 16:42
    
Yeah. :( lwn.net/Articles/435744 –  mattdm Mar 31 '11 at 17:01
    
It's available as of April, 2011. Whew. See CentOS 5.6 Release Notes –  Stefan Lasiewski Jul 30 '11 at 4:21
add comment

CentOS 6 is now available, and includes PHP 5.3:

http://isoredirect.centos.org/centos/6/isos/x86_64/

share|improve this answer
add comment

I had the same issue where "yum update php" would give me conflict errors.

Running "yum update" (update everything) did work for me though. Give that a try.

Also, realize that if you run "yum erase php" or "yum remove php", it may remove all packages that depend on PHP... which would probably include your Plesk or CPanel control panel if you have that installed. If I'm not mistaken, you would have to reinstall those, which could be a pain.

share|improve this answer
2  
Yes, I have exactly that problem. To upgrade PHP, yum wants to delete Drupal, which is not really a dependency: it requires PHP to work, but it doesn't quite care what version of PHP, as it is PHP source and not a compiled program. Any way to uninstall PHP5.2 and have it leave Drupal alone? –  bart Jun 7 '11 at 20:53
add comment

You are correct, you need to uninstall the default php packages first. Before going forward, keep in mind that other packages may have specific dependencies on the base versions. Chances are, you will be fine, but just be forwarned that you may need to address other concerns later.

You should be able to do this by issuing

yum erase php-common php-cli

Followed by your

yum install php53
share|improve this answer
add comment

Try removing the old versions of the packages before installing the new ones:

yum erase php-cli php-comon

then try your yum install.

Warning: look at the list of changes that yum wants to make before committing, to make sure you are not removing other important packages.

share|improve this answer
add comment

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.