Installation and opening method of PHP GD library under Linux

Source: Internet
Author: User
Tags gettext
    1. # tar Xvzf zlib-1.2.3.tar.gz
    2. # CD zlib-1.2.3
    3. #./configure
    4. # Make && make install
Copy Code

3, installation FreeType

    1. # tar Xvzf freetype-1.3.1.tar.gz
    2. # CD freetype-1.3.1
    3. #./configure--prefix=/usr/local/freetype
    4. # Make && make install
Copy Code

There are multiple lines of errors similar to: ftdump.c:172:1: error:pasting "." and "Glyph_object" does not give a valid preprocessing token

Workaround: Modify the code inside the TEST/FTDUMP.C: Change Print_mem (memory_footprint.# #field, String) to: Print_mem (Memory_footprint.field, String) Change #define footprint (field) save_memory (&memory_footprint.# #field) to: #define Footprint (field) Save_memo RY (&memory_footprint.field) reset && make install or modify makefile.in:

    1. 1. Remove the tttest from the All:ttlib tttest ttpo
    2. 2. Delete
    3. Install
    4. CD $ (FTLIBDIR); $ (make)-F $ (MAKEFILE) Install
    5. CD $ (FTTESTDIR); $ (make)-F $ (MAKEFILE) Install
    6. CD $ (FTPODIR); $ (make) Install
    7. In the CD $ (FTTESTDIR); $ (make)-F $ (MAKEFILE) Install
    8. #./configure--prefix=/usr/local/freetype
    9. # Make && make install
Copy Code

4, installation libpng

    1. # tar Xvzf libpng-1.5.2.tar.gz
    2. # CD libpng-1.5.2
    3. #./configure--prefix=/usr/local/libpng
    4. # Make && make install
Copy Code

5, Installation Jpegsrc

    1. # tar Xvzf jpegsrc.v6b.tar.gz
    2. # CD JPEGSRC.V6B
    3. #./configure--prefix=/usr/local/jpeg6–enable-shared–enable-static
    4. # Make && make install
Copy Code

Possible error: The prompt folder does not exist, should be the program can not automatically create folders, according to the error of the prompt, hand-use mkdir create files on it. This time for example:

    1. # mkdir-p/usr/local/jpeg6/include/
    2. # mkdir-p/usr/local/jpeg6/lib/
    3. # mkdir-p/usr/local/jpeg6/bin/cjpeg
    4. # mkdir-p/usr/local/jpeg6/man/man1/
Copy Code

6, install GetText (some directly have, you can install the GD library, error and then return to install)

    1. # tar Xvzf gettext-0.16.1.tar.gz
    2. # CD gettext-0.16.1
    3. #./configure--prefix=/usr/local/gettext
    4. # Make && make install
Copy Code

7. Install GD Library

    1. # tar Xvzf gd-2.0.35.tar.gz
    2. # CD gd-2.0.35
    3. #./configure--prefix=/usr/local/gd--with-jpeg=/usr/local/jpeg6--with-png=/usr/local/libpng--with-freetype=/usr /local/freetype
    4. # make
    5. # make Install
Copy Code

Configure ... Possible error in this step: configure.ac:64:error:possibly undefined macro:am_iconv, this must be installed GetText (in step 6)

8. Generate gd.so

    1. # CD: /php-5.2.17/ext/gd/
    2. #/usr/local/php5/bin/phpize
    3. #./configure--with-php-config=/usr/local/php5/bin/php-config--with-jpeg-dir=/usr/local/jpeg6/--with-png-dir=/ usr/local/libpng/--with-gd=/usr/local/gd/--with-freetype-dir=/usr/local/freetype/
    4. # Make && make install
Copy Code

At the end of make install there will be the location of GD inventory, from that folder to copy gd.so to the extension library directory

9, modify php.ini in the php.ini add the following content

    1. Extension=gd.so
Copy Code

10. End of installation, restart Apache Service

    1. # Service httpd Restart
Copy Code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.