在Centos系统安装完成之后,在配置环境的过程中往往需要gd库的运行,特别是用来处理图片的API,或是使用GD库来生成图片、处理图片等等,都是需要gd库的支持的!
GD库的作用:
GD库可以用来生成缩略图、针对图片加水印、用汉字来生成验证码,或是对网站数据生成报表等。
GD库的安装:
我们可以直接使用yum命令来安装,自动解决依赖关系及安装GD库相关的包。
[[email protected] ~]# yum install php-gd*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: centos.ustc.edu.cn
* updates: mirrors.yun-idc.com
adobe-linux-x86_64 | 951 B 00:00
adobe-linux-x86_64/primary | 1.2 kB 00:00
adobe-linux-x86_64 2/2
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 29 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-gd.x86_64 0:5.3.3-27.el6_5 will be updated
---> Package php-gd.x86_64 0:5.3.3-40.el6_6 will be an update
--> Processing Dependency: php-common(x86-64) = 5.3.3-40.el6_6 for package: php-gd-5.3.3-40.el6_6.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-27.el6_5 will be updated
---> Package php-common.x86_64 0:5.3.3-40.el6_6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================
Package Arch Version Repository Size
=============================================================================================
Updating:
php-gd x86_64 5.3.3-40.el6_6 updates 109 k
Updating for dependencies:
php-common x86_64 5.3.3-40.el6_6 updates 527 k
Transaction Summary
=============================================================================================
Upgrade 2 Package(s)
Total download size: 636 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-common-5.3.3-40.el6_6.x86_64.rpm | 527 kB 00:00
(2/2): php-gd-5.3.3-40.el6_6.x86_64.rpm | 109 kB 00:00
---------------------------------------------------------------------------------------------
Total 1.3 MB/s | 636 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : php-common-5.3.3-40.el6_6.x86_64 1/4
Updating : php-gd-5.3.3-40.el6_6.x86_64 2/4
Cleanup : php-gd-5.3.3-27.el6_5.x86_64 3/4
Cleanup : php-common-5.3.3-27.el6_5.x86_64 4/4
Verifying : php-gd-5.3.3-40.el6_6.x86_64 1/4
Verifying : php-common-5.3.3-40.el6_6.x86_64 2/4
Verifying : php-gd-5.3.3-27.el6_5.x86_64 3/4
Verifying : php-common-5.3.3-27.el6_5.x86_64 4/4
Updated:
php-gd.x86_64 0:5.3.3-40.el6_6
Dependency Updated:
php-common.x86_64 0:5.3.3-40.el6_6
Complete!
安装完成之后,gd库就已经安装到你的Centos系统中啦!
安装完成之后,gd库就已经安装到你的Centos系统中啦!