Install the GD support library of PHP in Linux (install the GD extension of PHP)

Source: Internet
Author: User
Tags zts
GD: Gd support library for installing PHP in Linux. Gd support library for installing PHP in Linux

1. Download

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.gzhttp: // sourceforge.net/projects/freetype/
Php-4.3.9.tar.gz http://www.php.net

Ii. Installation

1. Install zlib

Tar zxvf zlib-1.2.2.tar.gz
CD zlib-1.2.2
./Configure
Make
Make install

2. Install libpng

Tar zxvf libpng-1.2.7.tar.tar
CD libpng-1.2.7
CD scripts/
MV makefile. Linux ../makefile
CD ..
Make
Make install
Note that the makefile here is not generated using./configure, but copied directly from the scripts/

3. Install FreeType

Tar zxvf freetype-2.1.9.tar.gz
CD freetype-2.1.9
./Configure
Make
Make install

4. Install JPEG

Tar zxvf restart src.v6b.tar.gz
CD jpeg-6b/
./Configure -- enable-shared
Make
Make Test
Make install
Note: Here, configure must include the -- enable-shared parameter. Otherwise, the shared library will not be generated.

5. Install GD

Tar zxvf gd-2.0.33.tar.gz
CD gd-2.0.33
./Configure -- With-PNG -- With-FreeType -- With-JPEG
Make install

The above installation steps do not set the installation directory. You can use the above method to re-compile PHP.
To specify the installation address, use the following method. We recommend that you define the installation directory.

1. Install zlib wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/zlib-1.2.3.tar.gz tar-zxf zlib-1.2.3.tar.gz CD zlib-1.2.3. /configure-Prefix =/usr/local/zlib make install 2. Install JPEG wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/jpeg-6b.tar.gz mkdir-P/usr/local/IPv6 mkdir-P/usr/local/IPv6/bin mkdir-P/usr/local/users 6/lib mkdir-P/usr/local/users 6/include mkdir-P/usr/local/users 6/man Mkdir-P/usr/local/found 6/Man1 mkdir-P/usr/local/found 6/man/Man1 tar-zxf jpeg-6b.tar.gz CD jpeg-6b. /configure-Prefix =/usr/local/release 6-enable-shared-enable-static make install installation completion prompt: libraries have been installed in: /usr/local/release 6/lib 3. Install libpng wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/libpng-1.2.16.tar.gz tar-zxf libpng-1.2.16.tar.gz CD libpng-1.2.16. /configure-prefi X =/usr/local/libpng make install 4. Install FreeType wget http://download.savannah.nongnu.org/releases/freetype/freetype-2.3.4.tar.gz tar-zxf freetype-2.3.4.tar.gz CD freetype-2.3.4 mkdir-P/usr/local/FreeType. /configure-Prefix =/usr/local/FreeType make install 5, install GD wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/gd-2.0.33.tar.gz tar-zxf gd-2.0.33.tar.gz CD gd-2.0.33 mkdir-P/usr/L Ocal/GD2. /configure-Prefix =/usr/local/GD2-with-JPEG =/usr/local/defaults 6/-with-PNG =/usr/local/lib/-with-zlib = /usr/local/lib/-with-FreeType =/usr/local/FreeType/make install ------------------ when JPG is installed, if an error occurs. Install the libtool libtool-1.X.tar.gz first // the version I downloaded./configure make install and then install the libraries src.v6b.tar.gz./configure -- enable-shared -- enable-static libraries. Otherwise, if other users require this package, they must specify its path. This may cause an error in checking host system type... Invalid configuration 'x86 _ 64-unknown-linux-gnu ': Machine 'x86 _ 64-unknown' not recognized checking build system type... Invalid configuration 'x86 _ 64-unknown-linux-gnu ': Machine 'x86 _ 64-unknown' not recognized configure: Error: libtool configure failed or/libtool -- mode = compile gcc-O2-I. -C. /jcapimin. c make :. /libtool: Make: *** [jcapimin. lo] Error 127. /libtool -- mode = compile gcc-O2-I. -C. /cjpeg. c make :. /libtool: Make: *** [cjpeg. lo] Error 127 solution CP/usr/share/libtool/config. guess. CP/usr/share/libtool/config. sub. CP to the JPEG Installation File directory, pay attention to the following ". "Make clean and try again. /configure -- prefix =/usr/local/libjpeg/-- enable-shared -- enable-static make install -------------------------------- If PHP has been installed, we recommend that you use the append compilation and Installation Method to go to the "[PHP extract Directory]/EXT/GD" directory and execute the following command: [PHP installation directory]/bin/phpize Java code. /configure -- With-PHP-Config = [PHP installation directory]/bin/PHP-config -- With-JPEG = [jpeg-6b installation directory] -- With-PNG = [libpng installation directory] -- With-FreeType = [FreeType installation directory] -- With-gettext = [gettext installation directory] -- With-Gd = [Gd installation directory] Make make install PHP installation directory]/lib/PHP/extensions/no-debug-non-zts-20060613 "directory to generate GD. so file, then CP [PHP installation directory]/lib/PHP/extensions/no-debug-non-zts-20060613/GD. so/opt/PHP/EXT modify PHP. the INI file loads the GD component and adds extension_dir =/opt/PHP/EXT and extension = Gd. so, if you have extension_dir =/opt/PHP/EXT, you do not need to add the Java code extension_dir =/opt/PHP/EXT extension = Gd. so

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.