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库全部过程演示完了。
Centos安装GD库的更多相关文章
- centos安装GD库失败
Error: Package: php-gd-5.6.11-1.el6.remi.x86_64 (remi-php56) Requires: gd-last(x86-64) >= 2.1.1 E ...
- 烂泥:centos单独编译安装gd库
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 这几天一直在弄一个商城系统,该系统的源码及数据库都已经上传并创建完毕.但是在安装该系统时,却提示缺少gd库.如下: 使用php探针查看,发现php确实没 ...
- 【CentOS】php编译安装gd库
一.准备工作 使用之前服务器按源码最小化安装完nginx.php-fpm,没有安装gd库,下面介绍下gd库的安装. gd库是一个开源的图像处理库,它通过提供一系列用来处理图片的API,使其可以用来创建 ...
- linux centos系统 php安装GD库扩展
yum --enablerepo=remi-php56 install php-gd php-mysql php-mbstring php-xml php-mcrypt //安装GD库扩展 servi ...
- 安装GD库解决ThinkPHP 验证码Call to undefined function Think\imagecreate()出错
在php中imagecreate函数是一个图形处理函数,主要用于新建一个基于调色板的图像了,然后在这个基础上我们可以创建一些图形数字字符之类的,但这个函数需要GD库支持,如果没有开启GD库使用时会提示 ...
- CentOS 开启GD库
在php.ini 中没有找到"extension=php_gd2.dll"这行代码,这是因为CentOS一般没有预装GD库. 解决办法: 1.在线安装GD库 yum -y inst ...
- PHP 编译安装 gd 库
作者博文地址:https://www.cnblogs.com/liu-shuai/ 安装gd依赖库 freetype wget http://download.savannah.gnu.org/rel ...
- linux安装GD库
首先我们检查GD库是否安装 php -i | grep -i --color gd 安装GD库 yum install php-gd* 安装完成之后配置php.ini文件 extension=gd.s ...
- php5.6.30环境报错Call to undefined function ImageCreate() 编译安装 gd库
php5..30环境报错Call to undefined function ImageCreate() 编译安装 gd库 发现php5..30没有加载gd库 [root@cn_vs_web04:/u ...
随机推荐
- java枚举详解
枚举的本质是类,枚举是用来构建常量数据结构的模板(初学者可以以此方式理解: public static final X=xxx),枚举的使用增强了程序的健壮性,在引用一个不存在的枚举值的时候,编译器会 ...
- Java-集合第一篇认识Java集合
1.4种集合类型 List:有序可重复集合. Queue:队列集合. Set:无序不可重复集合. ------------------------------- Map:关系映射集合. 2.所有的集合 ...
- 问题 H: 小k的简单问题
问题 H: 小k的简单问题 时间限制: 1 Sec 内存限制: 128 MB提交: 107 解决: 57[提交] [状态] [命题人:jsu_admin] 题目描述 地图上有n个村庄,小k每个月需 ...
- C# 共享文件读取(转)
using System;using System.Runtime.InteropServices;using BOOL = System.Boolean;using DWORD = System.U ...
- 学Python的第五天
最近忙着学MySQL,但是小编也不会放弃学Python!!! 因为热爱所以学习~ 好了各位,进入正题,由于时间问题今天学的不是很多.... #!/usr/bin/env python # -*- co ...
- webpack webpack.config.js配置
安装指定版本的webpack npm install webpack@3.6 -g 安装live-server 运行项目插件 输入live-server 运行后自动打开网页 npm ins ...
- 三、Windows下用FFmpeg+nginx+rtmp搭建直播环境 实现推流、拉流
一.环境 1.开发环境:windows 2.开发工具:FFmpeg.nginx.nginx-rmtp-module (链接:https://pan.baidu.com/s/119d2GeMzddas_ ...
- c# 反射获取属性值 TypeUtils
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...
- 剖析 Vue.js 内部运行机制 (1)
1. new Vue() 之后. Vue 会调用 _init 函数进行初始化,也就是这里的 init 过程,它会初始化生命周 期.事件. props. methods. data. computed ...
- Java中Comparable接口和Comparator接口的简单用法
对象比较器 1.Comparable接口 此接口强行对实现它的每个类的对象进行整体排序,这种排序成为类的自然排序,类的compareTo方法称为类的自然比较方法. 代码示例 import java.u ...