• 已有的PHP安装gd扩展


     

    第一步 安装依赖

    1、安装xpm

    yum install libXpm-devel

    2、安装zlib

    复制代码
       wget http://www.zlib.net/fossils/zlib-1.2.8.tar.gz
       tar -xzvf zlib-1.2.8.tar.gz
       cd zlib-1.2.8
       ./configure 
       make && make install
       make clean && make distclean
       cd ../
    复制代码

    3、安装libjpeg jpeg-9b

    复制代码
    wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz
    tar -xzvf jpegsrc.v9b.tar.gz
    cd jpeg-9
    ./configure 
    --prefix=/usr/local/jpeg 
    --enable-shared 
    --enable-static
    
    make && make instll
    make clean && make distclean
    libtool --finish /usr/local/jpeg/lib
    cd ../
    复制代码

    4、安装libpng

    yum install libpng libpng-devel

    5、安装freetype2

    复制代码
    wget http://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.gz
    tar -xzvf freetype-2.7.tar.gz
    cd freetype-2.7
    ./configure 
    --prefix=/usr/local/freetype
    make && make install 
    make clean && make distclean
    cd ../
    复制代码

    第二步 安装gd扩展

    $ cd [php安装目录]
    $ cd ext/gd
    $ /usr/local/php/bin/phpize
    $ ./configure --with-php-config=/usr/local/php/bin/php-config --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype
    $ make
    $ make install

    安装成功后返回gd的安装位置:

    Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

     

    第三步 启用gd扩展

    然后打开/alidata/server/php-5.5.38/etc/php.ini

    ;extension=/path/to/extension/msql.so

    附近添加在一行

    extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

    最后重启php-fpm服务

  • 相关阅读:
    TOJ 2710: 过河 路径压缩
    树状数组模板
    TOJ 2017: N-Credible Mazes
    TOJ 4804: 树网的核
    Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2)
    Codeforces Round #441 (Div. 2, by Moscow Team Olympiad)
    TOJ 2541: Paper Cutting
    CODE FESTIVAL 2017 qual B
    hiho[Offer收割]编程练习赛30
    Codeforces Round #437 (Div. 2, based on MemSQL Start[c]UP 3.0
  • 原文地址:https://www.cnblogs.com/uvwill/p/14808496.html
Copyright © 2020-2023  润新知