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. 使用dib element proliant-tools制作deploy image

    element proliant-tools会在ipa ramdisk中安装一个rpm包hpssacli(HP的RAID管理工具),和一个python module proliantutils(里面P ...

  2. Linux特殊权限位

    SUID 运行某程序时,相应进程的属主是程序文件自身的属主,而不是启动者(启动者临时获得文件属主的权限)     chmod u+s file     chmod u-s file SGID 运行某程 ...

  3. GridView与ListView冲突

    由于GridView与listView都是继承自ScrollView,所以两个控件放在一起时需要重写控件方法   public class MyGridView extends GridView{  ...

  4. ComboBox列表自定义类保存数据

    之前没弄明白ComboBox还可以这样用. 先建一个ComboBox子项类,然后可以获取该项类做一些判断,关键是要重写ToString()方法. public class ComboItem { pu ...

  5. LeetCode -- Sum Root to Leaf NNumbers

    Related Links: Path Sum: http://www.cnblogs.com/little-YTMM/p/4529982.html Path Sum II: http://www.c ...

  6. TensorFlow应用实战 | TensorFlow基础知识

    挺长的~超出估计值了~预计阅读时间20分钟. 从helloworld开始 mkdir 1.helloworld cd 1.helloworldvim helloworld.py 代码: # -*- c ...

  7. 【ZBH选讲·模数和】

    [问题描述]你是能看到第二题的friends呢.——laekovHja和Yjq在玩游戏,这个游戏中Hja给了Yjq两个数,希望Yjq找到一些非负整数使得这些数的和等于n,并且所有数模maaaaaaaa ...

  8. 基于node的cmd迷你天气查询工具

    1.前几天网上看到的,于是自己小改了一下,更换了天气查询的接口,当作练习一下node. 2.收获挺大的,捣鼓了一天,终于学会了发布npm包. 3.接下来,就介绍一下这个 mini-tianqi 的主要 ...

  9. struct timeval和gettimeofday()

    http://www.cppblog.com/lynch/archive/2011/08/05/152520.html struct timeval结构体在time.h中的定义为: struct ti ...

  10. Linux将命令添加到PATH中【转】

    转自:http://www.jb51.net/LINUXjishu/150167.html 电脑中必不可少的就是操作系统.而Linux的发展非常迅速,有赶超微软的趋势.这里介绍Linux的知识,让你学 ...