How to install phpGD support libraries in linux

Source: Internet
Author: User
How to install phpGD support libraries in linux

  1. Gd-2.0.33.tar.gz http://www.boutell.com/gd/
  2. Jpegsrc.v6b.tar.gz http://www.ijg.org/
  3. Libpng-1.2.7.tar.tar http://sourceforge.net/projects/libpng/
  4. Zlib-1.2.2.tar.gz http://sourceforge.net/projects/zlib/
  5. Freetype-2.1.9.tar.gzhttp: // sourceforge.net/projects/freetype/
  6. Php-4.3.9.tar.gz http://www.php.net

II. Installation

1. install zlib

  1. Tar zxvf zlib-1.2.2.tar.gz
  2. Cd zlib-1.2.2
  3. ./Configure
  4. Make
  5. Make install

2. install libpng

  1. Tar zxvf libpng-1.2.7.tar.tar
  2. Cd libpng-1.2.7
  3. Cd scripts/
  4. Mv makefile. linux ../makefile
  5. Cd ..
  6. Make
  7. Make install

Note that the makefile here is not generated using./configure, but copied directly from the scripts/

3. install freetype

  1. Tar zxvf freetype-2.1.9.tar.gz
  2. Cd freetype-2.1.9
  3. ./Configure
  4. Make
  5. Make install

4. install Jpeg

  1. Tar zxvf restart src.v6b.tar.gz
  2. Cd jpeg-6b/
  3. ./Configure -- enable-shared
  4. Make
  5. Make test
  6. Make install

Note: Here, configure must include the -- enable-shared parameter. Otherwise, the shared library will not be generated.

5. install GD

  1. Tar zxvf gd-2.0.33.tar.gz
  2. Cd gd-2.0.33
  3. ./Configure -- with-png -- with-freetype -- with-jpeg
  4. 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

  1. Wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/zlib-1.2.3.tar.gz
  2. Tar-zxf zlib-1.2.3.tar.gz
  3. Cd zlib-1.2.3
  4. ./Configure-prefix =/usr/local/zlib
  5. Make
  6. Make install

2. install jpeg

  1. Wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/jpeg-6b.tar.gz
  2. Mkdir-p/usr/local/limit 6
  3. Mkdir-p/usr/local/partition 6/bin
  4. Mkdir-p/usr/local/IPv6/lib
  5. Mkdir-p/usr/local/users 6/include
  6. Mkdir-p/usr/local/IPv6/man
  7. Mkdir-p/usr/local/IPv6/man1
  8. Mkdir-p/usr/local/users 6/man/man1
  9. Tar-zxf jpeg-6b.tar.gz
  10. Cd jpeg-6b
  11. ./Configure-prefix =/usr/local/configure 6-enable-shared-enable-static
  12. Make
  13. Make install

Installation completion prompt: Libraries have been installed in:/usr/local/slave 6/lib 3. install libpng

  1. Wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/libpng-1.2.16.tar.gz
  2. Tar-zxf libpng-1.2.16.tar.gz
  3. Cd libpng-1.2.16
  4. ./Configure-prefix =/usr/local/libpng
  5. Make
  6. Make install

4. install freetype

  1. Wget http://download.savannah.nongnu.org/releases/freetype/freetype-2.3.4.tar.gz
  2. Tar-zxf freetype-2.3.4.tar.gz
  3. Cd freetype-2.3.4
  4. Mkdir-p/usr/local/freetype
  5. ./Configure-prefix =/usr/local/freetype
  6. Make
  7. Make install

5. install GD

  1. Wget ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/gd-2.0.33.tar.gz
  2. Tar-zxf gd-2.0.33.tar.gz
  3. Cd gd-2.0.33
  4. Mkdir-p/usr/local/gd2
  5. . /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/
  6. Make
  7. Make install

If an error occurs while installing jpg, you need to first install libtool: libtool-1.X.tar.gz // is the version I downloaded

  1. ./Configure
  2. Make
  3. Make install
  4. Then, install "src.v6b.tar.gz ".
  5. ./Configure -- enable-shared -- enable-static.

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 append compilation and installation to go to the "[php extract Directory]/ext/gd" directory and execute the following command: [php installation directory]/bin/phpize. /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 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 extension_dir =/opt/php/ext exists, you do not need to add 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.