linux GD库安装

GD 安裝

第一部需要做的是先要安裝 GD 到系統內,而安裝 GD 前需要安裝 jpeg-6b, libpng, zlib, freetype。以下是下载网址:
GD 2.0.33
jpeg-6b
libpng 1.2.8
zlib 1.2.3
freetype-2.1.10.tar.gz

代码:

wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz 
wget ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz 
wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8-config.tar.gz 
wget http://www.zlib.net/zlib-1.2.3.tar.gz 
wget http://prdownloads.sourceforge.net/freetype/freetype-2.1.10.tar.gz?download

安裝 zlib

#不要用-prefix指定安装目录会影响GD

代码:

tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure  #或者 CFLAGS="-O3 -fPIC" ./configure   #如果64位处理器需要 CFLAGS="-O3 -fPIC" 
make
make install

引用:

安装zlib-1.2.3.tar.gz
修改Makefile文件
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC

安裝 freetype

代码:

tar zxvf freetype-2.1.10.tar.gz
cd freetype-2.1.10
./configure -prefix=/usr/local/freetype
make
make install

安裝 libpng
#不要用-prefix指定安装目录会影响GD

代码:

tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
./configure
make
make install

=====有些用法=====
cp scripts/makefile.linux makefile
make 
make install
===============

安裝 jpeg-7

代码:

tar zxvf jpegsrc.7.tar.gz
cd jpeg-7
./configure -prefix=/usr/local/jpeg --enable-shared --enable-static
make
make install
=====有些用法=====
CFLAGS="-O3 -fPIC" ./configure   #如果64位处理器需要 CFLAGS="-O3 -fPIC" 
make
make install-lib
===============

這步有可能出錯,主要原因是不能自動建文件夾,到時出了問題,少那個文件夾,就自己用madir命令建那個文件夾就能解決

安裝 GD

代码:

tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure -prefix=/usr/local/gd -with-jpeg=/usr/local/jpeg -with-png -with-zlib -with-freetype=/usr/local/freetype
make
make install

下一步需要配置 PHP 。
注:安裝imap的方法先下載imap2006e.tar.gz.Z
在php編譯時加上-with-imap=下載後解開的文件夾
這個也有點小問題,在maik時會出utf8_mime2text的錯,解決方法是先用find 查一下php源文件下的ext/php_imap.c 這個文件,然後用vi編緝他,查找utf8_mime2text,然後刪除那二行.
然後在重新編譯php就可以解決

PHP 配置
現在需要重新編譯 PHP,並選擇支援 GD,如果系統內已刪除了 PHP 的原始碼,可以到 php.net 下載,然後輸入以下指令:
請在configure 後加上如下
-with-gd=/usr/local/gd
-with-jpeg-dir=/usr/local/jpeg6 -with-zlib -with-png
-with-freetype-dir=/usr/local/freetype

代码:

--prefix=/usr/local/php --enable-sockets --enable-xsl --enable-xml --with-apxs2=/usr/local/apache/bin/apxs --witlih-mysql=/usr/local/mysql --enable-json --enable-mbstring --enable-pdo --enable-libxml --enable-simplexml --enable-xmlreader --enable-xmlwriter --with-zlib --with-pdo-mysql=/usr/local/mysql --with-curl=/usr/local/curl --with-jpeg-dir=/usr/local/jpeg -with-png  --with-gd=/usr/local/gd --with-freetype-dir=/usr/local/freetype

linux PHP 安装及 GD库安装的更多相关文章

  1. Linux gd库安装步骤说明

    gd 库是 PHP 处理图形的扩展库,它提供了一系列用来处理图片的 API(应用程序编程接口),使用 gd 库可以处理图片或者生成图片.在网站上,gd 库通常用来生成缩略图,或者对图片加水印,或者生成 ...

  2. phpize 扩展GD库 安装 ! 环境--centos 7 +nginx 1.7.11+php 5.6.7

    使用phpize编译GD库安装,先安装前置库libjpeg libpng zlib  freetype等 都是下面php编译的几个选项 先看php编译的选项: --with-gd=DIR       ...

  3. CentOS单独编译安装PHP gd库扩展

    注意:如果您已经编译安装过GD库,请重新编译安装php不带gd库成功后,执行以下操作 安装libpng wget http://jaist.dl.sourceforge.net/project/lib ...

  4. CentOS6.8单独编译安装PHP gd库扩展

    # PHP-GD安装 #在安装之前可以先更新一下yum源,可以使用国内的阿里云源 yum -y install libjpeg-turbo-devel yum -y install freetype- ...

  5. yum install php-gd 安装php gd库报错Error: php56w-common conflicts with php-common-5.3.3-48.el6_8.x86_64 大

    yum install php-gd安装php gd库报错Error: php56w-common conflicts with php-common-5.3.3-48.el6_8.x86_64大概的 ...

  6. PHP gd_info - 取得当前安装的 GD 库的信息

    gd_info — 取得当前安装的 GD 库的信息. 语法 array gd_info ( void )高佣联盟 www.cgewang.com 返回一个关联数组描述了安装的 GD 库的版本和性能. ...

  7. LINUX 安装PHP GD库遇到的坑

    本文借鉴:https://www.cnblogs.com/gaohj/p/3152646.html linux下为php添加GD库的步骤如下: 一.下载 gd-.tar.gz http://www.b ...

  8. PHP中GD库安装

    安装gd库扩展不能像其他扩展安装一样,直接./configure --prefix=/xxx 还需要激活png,jpeg,字库等支持 ./configure --prefix=/xxx --with- ...

  9. dedecms安装操作-重安装-开启GD库

    wamp5_1.7.4 打开:http://localhost/install/安装 (输入:域名/install,回车跳转到安装界面,勾选“我已经阅读并同意此协议”,然后点击“继续按钮”.) 重安装 ...

随机推荐

  1. ocrosoft Contest1316 - 信奥编程之路~~~~~第三关 问题 M: 当总统

    http://acm.ocrosoft.com/problem.php?cid=1316&pid=12 题目描述 小明想当丑国的总统,丑国大选是按各州的投票结果来确定最终的结果的,如果得到超过 ...

  2. 【bzoj1044】[HAOI2008]木棍分割 二分+dp

    题目描述 有n根木棍, 第i根木棍的长度为Li,n根木棍依次连结了一起, 总共有n-1个连接处. 现在允许你最多砍断m个连接处, 砍完后n根木棍被分成了很多段,要求满足总长度最大的一段长度最小, 并且 ...

  3. thinkPHP判断是否修改成功

    thinkPHP中使用save方法来更新数据的save方法的正常执行时返回值是影响的记录数,出错时返回false,返回为0和返回false在很多业务场景下都是不同的. 而当修改的内容和原有内容一致的时 ...

  4. [poj] 3422 Kaka's Matrix Travels || 最小费用最大流

    原题 给一个N*N的方阵,从[1,1]到[n,n]走K次,走过每个方格加上上面的数,然后这个格上面的数变为0.求可取得的最大的值. 要求最大值,所以把边权全为负跑最小费用即可.因为只有第一次经过该点的 ...

  5. VMware HA 特性

    关键特性1.自动检测服务器故障.VMware HA 自动监控物理服务器的可用性.VMware HA 可检测物理服务器故障,并且无需人工干预即可重新启动资源池中其他物理服务器上的新虚拟机.2.自动检测操 ...

  6. js中字符串常规操作

    string对象属性: 1.length 获取字符串的长度,需要注意的是,js中中文每个汉字也只代表一个字符. var myName="xulinjun"; console.log ...

  7. Apache二级域名实现

    Apache二级域名实现 首先,你的拥有一个有泛域名解析的顶级域名,例如: domain.com 其次,在 httpd.conf 中打开 mod_rewrite 之后,在 httpd.conf 的最后 ...

  8. [poj_3469]多核CPU

    Sample Input 3 1 1 10 2 10 10 3 2 3 1000 Sample Output 13 最小割,把模块看做点,建源点s和汇点t,以下(a,b,c)表示从a向b连一条容量为c ...

  9. linux 安装 pip

    # wget https://bootstrap.pypa.io/get-pip.py # python get-pip.py

  10. centos 7 编译mod_security

    yum install gcc-c++ flex bison yajl yajl-devel curl-devel curl GeoIP-devel doxygen zlib-devel libtoo ...