PHP installation errors on Centos6

I am new to server and Linux, and I ran into some problems. I am trying to update my PHP by looking for linux commands over the network. Some commands performed fine, and some did 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, this gives me the following error message:

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

Here is the information 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 I did wrong by updating my php? Should I delete all php files on my server and reinstall? How?

+6
source share
4 answers

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

and changed the file name "remi.repo" in the /etc/yum.repos.d folder, as shown below:

 [remi-php56] name=Remi 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 

make sure php56 is enabled = 1.

+12
source

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

+2
source

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

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

I found this by running yum search php56

+1
source

You should run:

 yum install php56w-gd 

Therefore, when installing php-extension has an error:

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

Just enter *-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 for this error is the installation of a PHP version that does not match the version of the system repo. So yum gets the system repo version, but it is not compatible with the php version you installed. When you set the php version, yum will get the correct version, so happy!

0
source

All Articles