zoukankan      html  css  js  c++  java
  • linux php 安装GD库

    linux下为php添加GD库的步骤如下: 


    一、下载 

    gd-2.0.33.tar.gz http://www.boutell.com/gd/ 
    jpegsrc.v6b.tar.gz http://www.ijg.org/ 
    libpng-1.2.7.tar.tar http://sourceforge.net/projects/libpng/ 
    zlib-1.2.2.tar.gz http://sourceforge.net/projects/zlib/ 
    freetype-2.1.9.tar.gz http://sourceforge.net/projects/freetype/ 
    php-4.3.9.tar.gz http://www.php.net 


    二、安装 

    1.安装zlib 

    tar zxvf zlib-1.2.2.tar.gz 
    cd zlib-1.2.2 
    ./configure 
    make 
    make install 

    2.安装libpng 

    tar zxvf libpng-1.2.7.tar.tar 
    cd libpng-1.2.7 
    cd scripts/ 
    mv makefile.linux ../makefile 
    cd .. 
    make 
    make install 
    注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个 

    【出错的话:collect2: ld returned 1 exit status

    make: *** [pngtest] Error 1

    可以直接编译./configure –prefix=/usr/local/libpng】


    3.安装freetype 

    tar zxvf freetype-2.1.9.tar.gz 
    cd freetype-2.1.9 
    ./configure 
    make 
    make install 

    4.安装Jpeg 

    tar zxvf jpegsrc.v6b.tar.gz 
    cd jpeg-6b/ 
    ./configure --enable-shared 
    make 
    make test 
    make install 
    注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库 

    5.安装GD 

    tar zxvf gd-2.0.33.tar.gz 
    cd gd-2.0.33 
    ./configure --with-png --with-freetype --with-jpeg 
    make install 

    6.重新编译PHP 

    tar zxvf php-4.3.9.tar.gz 
    cd php-4.3.9 
    ./configure (以前的参数) --with-gd --enable-gd-native-ttf --with-zlib --with-png --with-jpeg --with-freetype --enable-sockets 
    make 
    make install 

    <?php 
    phpinfo(); 
    ?> 

    Ok.....

  • 相关阅读:
    联合查询
    单表查询
    表和表之间的关系
    mysql完整性约束
    mysql 数据类型
    DRBD 数据镜像软件
    Memcached
    Redis
    SVN版本控制服务
    大数据hadoop分布式系统
  • 原文地址:https://www.cnblogs.com/gaohj/p/3152646.html
Copyright © 2011-2022 走看看