Centos6上的PHP安装冲突 [英] PHP installation conflicts on Centos6

查看:119
本文介绍了Centos6上的PHP安装冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是服务器和Linux的新手,遇到了一些问题.我正在尝试通过网络查找linux命令来更新我的PHP.有些命令运行得很好,但有些却没有.

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.

我尝试使用此命令安装php-gd,因为我收到此错误消息缺少所需的GD库".因此,我尝试在下面运行此代码:

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

您知道我在升级php时做错了什么吗?我应该删除服务器上的所有php文件并重新安装吗?怎么样?

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

推荐答案

使用"yum remove php php-common"删除所有php,解决了该问题

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

并修改了/etc/yum.repos.d文件夹下的文件名"remi.repo",如下所示:

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

确保已启用php56 = 1.

making sure that php56 is enabled=1.

这篇关于Centos6上的PHP安装冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆