Centos如何编译部署GD Library(库) | 少将全栈
  • 欢迎访问少将全栈,学会感恩,乐于付出,珍惜缘份,成就彼此、推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 吐槽,投稿,删稿,交个朋友
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏少将全栈吧

Centos如何编译部署GD Library(库)

Linux admin 5年前 (2019-11-22) 8712次浏览 已收录 扫描二维码

最近在安装和部署fastdfs,其中nginx模块需要依赖gd库

1 理论知识

1.1 GD的简介

About

What is the GD library?

GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve website development.

The library was originally developed by Thomas Boutell and is now maintained by Pierre Joye under the umbrella of PHP.net.

什么是GD库?

GD是一个开放源代码库,用于程序员动态创建图像。GD用C编写,可用于Perl,PHP和其他语言。GD创建PNG,JPEG,GIF,WebP,XPM,BMP图像等格式。

GD通常用于动态生成图表,图形,缩略图以及大多数其他内容。尽管不限于在Web上使用,但GD最常见的应用程序涉及网站开发。

1.2 GD的作用

GD is an open source code library for the dynamic creation of images by programmers.

GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD can read and write many different image formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly.

The most common applications of GD involve website development, although it can be used with any standalone application!

The library was originally developed by Thomas Boutell and is now maintained by many contributors (see the CONTRIBUTORS file) under the umbrella of PHP.net.

If you like to contribute, report bugs, see how to contribute document

For security related issues, please contact us at security@libgd.org

Downloads/etc…

Please visit our homepage for more details.

Supported Image Formats

GD has builtin support for:

It also has optional support for more formats via external libraries:

1.3 编译的目的

解决以下编译依赖的版本提示,

configure: error: Unable to find libgd.(a|so) >= 2.1.0 anywhere under /usr

2 最佳实践

2.1 准备编译环境

yum -y install gcc gcc-c++ make expat-devel

2.2 编译GD

2.2.1 下载GD

cd ~
wget https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz

2.2.2 解压安装包

cd ~
tar -xf libgd-2.2.5.tar.gz

2.2.3 预编译GD

cd ~/libgd-2.2.5
./configure --bindir=/usr/sbin/ \
            --sbindir=/usr/sbin/ \
            --sysconfdir=/etc/ \
            --libdir=/usr/lib64/ \
            --mandir=/usr/share/man/

2.2.4 编译并安装GD

make
make install

 

GD官方首页 http://libgd.github.io/

GD的下载 https://github.com/libgd/libgd/releases

喜欢 (4)
[🍬谢谢你请我吃糖果🍬🍬~]
分享 (0)
关于作者:
少将,关注Web全栈开发、项目管理,持续不断的学习、努力成为一个更棒的开发,做最好的自己,让世界因你不同。