• Centos安装GD库


    tar zxvf ncurses-5.6.tar.gz 进入目录 cd ncurses-5.6
    生成 makefile文件,
    再进一步编译
    ./configure --prefix=/usr --with-shared --without-debug 编译,编译时间稍微长些,稍等
    make
    编译好最后就是安装了
    make install
    ==================================
    下面才开始安装 GD库,安装gd库成功与否,与下面的安装顺序有一定的关系 我们就一步步来演示安装, 下面所有用到的文件,可以到 http://www.tabcn.cn/download/gd_all.7z下载 把全部的文件 都放进 webserv 目录下
    1: 安装zlib2 同样, 在Linux下使用 wget 来下载文件 tar zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure --prefix=/usr/local/zlib make make install
    ---------------------------------
    2:安装PNG
    tar zxvf libpng-1.2.26.tar.gz cd libpng-1.2.26
    cp scripts/makefile.linux ./makefile
    ./configure --prefix=/usr/local/libpng
    make
    make install
    ---------------------------------
    3:安装ttf ( ttf 是字体的支持 )
    tar zxvf freetype-2.3.5.tar.gz cd freetype-2.3.5
    ./configure --prefix=/usr/local/freetype
    make
    make install
    ---------------------------------
    4:安装JPEG6
    tar zxvf jpegsrc.v6b.tar.gz
    cd jpeg-6b
    mkdir -pv /usr/local/libjpeg/{,bin,lib,include,man/man1,man1}
    上面这个命令具体是实现这样的:
    mkdir: created directory `/usr/local/libjpeg'
    mkdir: created directory `/usr/local/libjpeg/bin'
    mkdir: created directory `/usr/local/libjpeg/lib'
    mkdir: created directory `/usr/local/libjpeg/include'
    mkdir: created directory `/usr/local/libjpeg/man'
    mkdir: created directory `/usr/local/libjpeg/man/man1'
    mkdir: created directory `/usr/local/libjpeg/man1'
    可以说是一个小小的bug吧,要我们手动建立这些目录,否则configure时候会说找不到目录。
    ./configure --prefix=/usr/local/libjpeg --enable-shared --enable-static
    make
    make install
    ---------------------------------
    5:安装 libxml2
    tar zxvf libxml2-2.6.31.tar.gz
    cd libxml2-2.6.31
    ./configure --prefix=/usr/local/libxml2
    make
    这一步make 操作 时间相对也会比较长,呵呵
    make install
    cp xml2-config /usr/bin
    ---------------------------------
    6:安装 libmcrypt-2.5.7.tar.gz
    tar zxvf libmcrypt-2.5.7.tar.gz
    cd libmcrypt-2.5.7
    ./configure
    make
    make install
    ---------------------------------
    7:安装Fontconfig
    tar -zxvf fontconfig-2.4.2.tar.gz
    cd fontconfig-2.4.2
    可以看到, 参数比较长, 我建议用记事本的朋友不要选择 自动换行。
    看我操作, 自动换行 复制过去执行有时会出错。
    去掉 自动换行
    ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
    这里显示一个错误信息:
    checking for LIBXML2... configure: error: Package requirements (libxml-2.0 >= 2.6) were not met: No package 'libxml-2.0' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBXML2_CFLAGS and LIBXML2_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
    但是我们在上面其实已经安装上 libxml2 了的,这里只是一个 环境变量没有设置好而已。
    解决办法:
    确定 /usr/local/libxml2/lib/pkgconfig 目录下有 libxml-2.0.pc
    export PKG_CONFIG_PATH=/usr/local/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
    再次生成 makefile , 这样就成功了
    ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
    好了吧,没有出现那个错误了。
    make
    make install
    ---------------------------------
    8:安装GD库,
    我们把这一步放在最后面
    tar zxvf gd-2.0.35.tar.gz cd gd-2.0.35 ./configure --prefix=/usr/local/libgd --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/libjpeg --with-fontconfig=/usr/local/fontconfig
    看到下面的信息, 呵呵 很多都显示支持了 Support for PNG library: yes Support for JPEG library: yes Support for Freetype 2.x library: yes Support for Fontconfig library: yes Support for Xpm library: no Support for pthreads: yes make make install 好了, 到这里为止 安装GD库全部过程演示完了。

    个人作品展示:www.jinyuanbao.cn
  • 相关阅读:
    GJM :动作手游实时PVP 帧同步(客户端)[转载]
    GJM :多人在线游戏的设计思路
    GJM : 中断被Socket.Accept阻塞的线程
    GJM :异步Socket [转载]
    GJM :C#开发 异步处理是目的,多线程是手段
    GJM : FlatBuffers 与 protobuf 性能比较 [转载 ]
    GJM : Protobuf -NET 相比Json 传输速度只需要1/3 解析只需要1/10
    GJM : Unity3D结合ZXING制作二维码识别
    GJM : Unity3D 常用网络框架与实战解析 【笔记】
    javascripct数组
  • 原文地址:https://www.cnblogs.com/jyb2014/p/4048411.html
Copyright © 2020-2023  润新知