搜索

首页  >  问答  >  正文

linux - 请问CentOs 6.5升级到php5.5后如何打开GD扩展库?

我用tp5做了一个项目,部署到了云服务器上【CentOs 6.5】,我安装lamp环境时yum获取的php是5.3的,因为框架需要,所以我就升级php内核到5.5.3,但是发现其缺少gd库,在低版本的php中只需在php.ini中打开extension = php_gd2就可以了,但是我发现在5.5中不行,于是我尝试安装gd库,可是我换了好几种方式也安装不了gd扩展,而且其缺少的依赖全是5.3的包,不知为何,请高手帮忙解决。

[root@VM_202_132_centos html]# yum install php-gd*
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * webtatic: us-east.repo.webtatic.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-gd.x86_64 0:5.3.3-48.el6_8 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-48.el6_8 for package: php-gd-5.3.3-48.el6_8.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-48.el6_8 will be installed
--> Processing Conflict: php55w-common-5.5.38-1.w6.x86_64 conflicts php-common < 5.5
--> Finished Dependency Resolution
Error: php55w-common conflicts with php-common-5.3.3-48.el6_8.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@VM_202_132_centos html]# 

PHPzPHPz2776 天前463

全部回复(3)我来回复

  • 巴扎黑

    巴扎黑2017-04-11 09:52:03

    这种问题就是版本不兼容导致的,你还是重装一下php吧

    回复
    0
  • 大家讲道理

    大家讲道理2017-04-11 09:52:03

    重新安装 php5.5,不要忘记 gd
    很难吗,还升级php ,你有才 !

    回复
    0
  • PHPz

    PHPz2017-04-11 09:52:03

    这边给你提供安装php5.6的yum方法扩展自选。
    # rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
    # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

    # yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof空格跟上自己想要的扩展
    # yum --enablerepo=remi-php56 install php-gd php-mysql php-mbstring php-xml php-mcrypt忘记的扩展在运行一次就ok了

    回复
    0
  • 取消回复