记录一次centos安装GD库,call to undefined function imagecreate()

58 篇文章 0 订阅
19 篇文章 0 订阅

记录一次centos安装GD库

  • 采用phpize的方式安装,也不成功
    提示Cannot find config.m4.
[root@hotdata gd]# php -i | grep -i --color gd
PWD => /usr/include/php/ext/gd
_SERVER["PWD"] => /usr/include/php/ext/gd

[root@hotdata gd]# yum -y install m4
Loaded plugins: security
Setting up Install Process
Package m4-1.4.13-5.el6.x86_64 already installed and latest version
Nothing to do
[root@hotdata gd]# yum -y install autoconf
Loaded plugins: security
Setting up Install Process
Package autoconf-2.63-5.1.el6.noarch already installed and latest version
Nothing to do
[root@hotdata gd]# /usr/bin/phpize 
Cannot find config.m4. 
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module


  • 直接使用yum命令安装不成功,错误信息如下:
    主要提示信息为需要安装依赖包,可是我已经安装了
# yum install gd gd-devel php-gd
Loaded plugins: security
Setting up Install Process
Package gd-2.0.35-11.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gd-devel.x86_64 0:2.0.35-11.el6 will be installed
--> Processing Dependency: libpng-devel for package: gd-devel-2.0.35-11.el6.x86_64
--> Processing Dependency: libjpeg-devel for package: gd-devel-2.0.35-11.el6.x86_64
--> Processing Dependency: libXpm-devel for package: gd-devel-2.0.35-11.el6.x86_64
--> Processing Dependency: libX11-devel for package: gd-devel-2.0.35-11.el6.x86_64
--> Processing Dependency: freetype-devel for package: gd-devel-2.0.35-11.el6.x86_64
--> Processing Dependency: fontconfig-devel for package: gd-devel-2.0.35-11.el6.x86_64
---> Package php-gd.x86_64 0:5.4.45-56.el6.art will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.45-56.el6.art for package: php-gd-5.4.45-56.el6.art.x86_64
--> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.4.45-56.el6.art.x86_64
--> Running transaction check
---> Package fontconfig-devel.x86_64 0:2.8.0-5.el6 will be installed
---> Package freetype-devel.x86_64 0:2.3.11-17.el6 will be installed
--> Processing Dependency: freetype = 2.3.11-17.el6 for package: freetype-devel-2.3.11-17.el6.x86_64
---> Package libX11-devel.x86_64 0:1.6.4-3.el6 will be installed
--> Processing Dependency: libX11 = 1.6.4-3.el6 for package: libX11-devel-1.6.4-3.el6.x86_64
--> Processing Dependency: pkgconfig(xcb) >= 1.11.1 for package: libX11-devel-1.6.4-3.el6.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libX11-devel-1.6.4-3.el6.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.4-3.el6.x86_64
--> Processing Dependency: pkgconfig(kbproto) for package: libX11-devel-1.6.4-3.el6.x86_64
---> Package libXpm-devel.x86_64 0:3.5.10-2.el6 will be installed
--> Processing Dependency: libXt.so.6()(64bit) for package: libXpm-devel-3.5.10-2.el6.x86_64
---> Package libjpeg-turbo-devel.x86_64 0:1.2.1-3.el6_5 will be installed
---> Package libpng-devel.x86_64 2:1.2.49-2.el6_7 will be installed
---> Package php-gd.x86_64 0:5.4.45-56.el6.art will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.45-56.el6.art for package: php-gd-5.4.45-56.el6.art.x86_64
---> Package t1lib.x86_64 0:5.1.2-6.el6_2.1 will be installed
--> Running transaction check
---> Package freetype.x86_64 0:2.3.11-15.el6_6.1 will be updated
---> Package freetype.x86_64 0:2.3.11-17.el6 will be an update
---> Package libX11.x86_64 0:1.6.0-6.el6 will be updated
---> Package libX11.x86_64 0:1.6.4-3.el6 will be an update
--> Processing Dependency: libX11-common = 1.6.4-3.el6 for package: libX11-1.6.4-3.el6.x86_64
---> Package libXt.x86_64 0:1.1.4-6.1.el6 will be installed
---> Package libxcb-devel.x86_64 0:1.12-4.el6 will be installed
--> Processing Dependency: libxcb = 1.12-4.el6 for package: libxcb-devel-1.12-4.el6.x86_64
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.12-4.el6.x86_64
--> Processing Dependency: libxcb-xkb.so.1()(64bit) for package: libxcb-devel-1.12-4.el6.x86_64
--> Processing Dependency: libxcb-xinput.so.0()(64bit) for package: libxcb-devel-1.12-4.el6.x86_64
--> Processing Dependency: libxcb-sync.so.1()(64bit) for package: libxcb-devel-1.12-4.el6.x86_64
--> Processing Dependency: libxcb-present.so.0()(64bit) for package: libxcb-devel-1.12-4.el6.x86_64
--> Processing Dependency: libxcb-dri3.so.0()(64bit) for package: libxcb-devel-1.12-4.el6.x86_64
---> Package php-gd.x86_64 0:5.4.45-56.el6.art will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.45-56.el6.art for package: php-gd-5.4.45-56.el6.art.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-14.el6 will be installed
--> Running transaction check
---> Package libX11-common.noarch 0:1.6.0-6.el6 will be updated
---> Package libX11-common.noarch 0:1.6.4-3.el6 will be an update
---> Package libXau-devel.x86_64 0:1.0.6-4.el6 will be installed
---> Package libxcb.x86_64 0:1.9.1-3.el6 will be updated
---> Package libxcb.x86_64 0:1.12-4.el6 will be an update
---> Package php-gd.x86_64 0:5.4.45-56.el6.art will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.45-56.el6.art for package: php-gd-5.4.45-56.el6.art.x86_64
--> Finished Dependency Resolution
Error: Package: php-gd-5.4.45-56.el6.art.x86_64 (atomic)
           Requires: php-common(x86-64) = 5.4.45-56.el6.art
           Installed: php-common-5.6.16-1.el6.remi.x86_64 (@remi-php56)
               php-common(x86-64) = 5.6.16-1.el6.remi
           Available: php-common-5.3.3-49.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-49.el6
           Available: php-common-5.4.45-54.el6.art.x86_64 (atomic)
               php-common(x86-64) = 5.4.45-54.el6.art
           Available: php-common-5.4.45-56.el6.art.x86_64 (atomic)
               php-common(x86-64) = 5.4.45-56.el6.art
           Available: php55w-common-5.5.38-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 5.5.38-1.w6
           Available: php56w-common-5.6.40-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 5.6.40-1.w6
           Available: php70w-common-7.0.33-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 7.0.33-1.w6
           Available: php71w-common-7.1.26-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 7.1.26-1.w6
           Available: php71w-common-7.1.27-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 7.1.27-1.w6
           Available: php71w-common-7.1.28-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 7.1.28-1.w6
           Available: php71w-common-7.1.29-1.w6.x86_64 (webtatic)
               php-common(x86-64) = 7.1.29-1.w6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

  • 最后采用这种方式安装成功了
yum install php-gd --enablerepo=remi-php56
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值