PHP installation conflicts on Centos6

18,825

Solution 1

Solved it by removing all php using "yum remove php php-common"

and modified the filename "remi.repo" under the folder /etc/yum.repos.d like below:

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1

making sure that php56 is enabled=1.

Solution 2

You should run:

yum install php56w-gd

So when install php-extension have error:

*-common conflicts with php-common-5.3.3-46.el6_6.x86_64

Just type *-extension

Example:

yum install php-fpm have error

Error: php56u-common conflicts with php-common-5.3.3-46.el6_7.1.x86_64

then you should run

yum install php56u-fpm

The reason of this error is you install a php version don't match the system repo version. So yum get a version of the system repo, but this don't compatible with the php version you have installed. When you specific the php version, yum get the right version, so happy!

Solution 3

Go to /etc/yum.repos.d. Remove the extra repository that you can see in your complete error message. Nima

Solution 4

If you are using Centos 6.7 and have php 5.6 installed, the following command worked for me:

sudo yum install php56w-pecl-xdebug.x86_64 (I was installing xdebug, not GD)

I found this by running yum search php56

Share:
18,825
nodeffect
Author by

nodeffect

Wannabe Programmer

Updated on June 04, 2022

Comments

  • nodeffect
    nodeffect almost 2 years

    I'm new to server and linux and I ran into some problems. I'm trying to update my PHP by looking for linux commands through the net. Some commands ran perfectly but some not.

    I tried using this command to install php-gd since I have this error message 'Required GD library is missing'. So, I tried to run this below:

    yum install php-gd
    

    However, it give me this error message below:

    php56w-common conflicts with php-common-5.3.3-46.el6_6.x86_64
    

    Here are some info on my server:

    [root@uat ~]# rpm -ql php
    package php is not installed
    
    [root@uat ~]# rpm -qa php\*
    php56w-pdo-5.6.11-1.w6.x86_64
    php56w-5.6.11-1.w6.x86_64
    php56w-cli-5.6.11-1.w6.x86_64
    php56w-common-5.6.11-1.w6.x86_64
    php56w-mysql-5.6.11-1.w6.x86_64
    
    [root@uat ~]# rpm -Va php\*
    S.5....T.  c /etc/php.ini
    [root@uat ~]# which php
    /usr/bin/php
    
    [root@uat ~]# php -v
    PHP 5.6.11 (cli) (built: Jul 10 2015 22:43:20)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    

    Do you know what have I done wrong upgrading my php? Should I remove all php files on my server and reinstall? How?

  • mishka
    mishka over 8 years
    here is what I see and not sure which repo to remove/comment out. yum install php-common Loaded plugins: fastestmirror, replace Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.advancedhosters.com * epel: mirror.cogentco.com * extras: mirror.netdepot.com * ius: mirror.symnds.com * updates: mirror.cogentco.com * webtatic: us-east.repo.webtatic.com Error: php55w-common conflicts with php-common-5.3.3-46.el6_6.x86_64 You could try using --skip-broken to work around the problem
  • mishka
    mishka over 8 years
    I tried yum update as well, before tying to install php-mbstring