author: fallseir.lee (fallseir at gmail.com)
tags:php,gd,画图

备份以前的php安装配置
  $ php -r "phpinfo();"
        |awk ‘/Configure Command/’    # 获取当前安装的php的配置
  { Configure Command => 
        ‘./configure’
        ‘–with-apxs=/home/apache/bin/apxs’

        ‘–enable-track-vars’
        ‘–with-iconv’
        ‘–with-mbstring’
        ‘–with-sqlite’

        ‘–without-mysql’
        ‘–with-curl’}
添加gd包支持
  由于gd中的png需要zlib
    查找zlib的位置
      $ whereis zlib
      {zlib: /usr/include/zlib.h
        /usr/share/man/man3/zlib.3.gz}
  $ sudo ./configure
        –with-apxs=/home/apache/bin/apxs

        –with-apxs=/home/apache/bin/apxs
        –with-iconv
        –with-mbstring
        –with-sqlite

        –without-mysql
        –with-curl
        –with-gd
        –with-zlib-dir=/usr/include/

重新安装php 
  $ sudo make
  $ sudo make install
 
查看当前安装的模块
  $ php -m
 
$ ll /usr/share/fonts/chinese/TrueType/bsmi00lp.ttf
 
gd 官方网站 http://www.boutell.com/gd/
freetype http://www.freetype.org/
 download http://sourceforge.net/projects/freetype/ 
 
$ ‘./configure’
    ‘–with-apxs=/home/apache/bin/apxs’
    ‘–enable-track-vars’
    ‘–with-iconv’
    ‘–with-mbstring’
    ‘–with-sqlite’
    ‘–without-mysql’
    –with-gd
    –with-zlib-dir=/usr/include/
    –with-ttf-dir=/usr/lib
    –with-freetype-dir=/usr/lib
    –with-jpeg-dir=/usr/lib
    –with-xpm-dir=/usr/X11R6
    –with-tiff-dir=/usr/lib

 

 

technorati tags: , ,