Compile GD in linux (freetype + libjpeg + libpng + gd-devel)

Source: Internet
Author: User

Compile GD in linux (freetype + libjpeg + libpng + gd-devel)
1. Check whether freetype is installed
Rpm-qa | grep freetype
If not, compile freetype and download it here.
./Configure -- prefix =/usr/local/freetype

Make & make install.

2. Check whether libjpeg is installed.
Rpm-qa | grep libjpeg
If not, compile libjpeg and download it here.
I haven't installed libjpeg either. Download it and start compiling.
Jpegsrc.v6b.tar.gz
Tar-xzvf restart src.v6b.tar.gz
Cd jpeg-6b/
./Configure -- prefix =/usr/local/jpeg -- enable-shared
Make & make install
An error occurred while making install:
/Usr/bin/install-c-m 644 jconfig. h/usr/local/jpeg/include/jconfig. h
/Usr/bin/install: cannot create regular file '/usr/local/jpeg/include/jconfig. H': No such file or directory
Make: *** [install-headers] Error 1
/Usr/bin/install: cannot create regular file '/usr/local/jpeg/lib/libjpeg. so.62.0.0': No such file or directory
/Usr/bin/install: cannot create regular file '/usr/local/jpeg/bin/cjpeg': No such file or directory
Make: *** [install-lib] Error 1
Isn't the installation program able to create a new directory by itself ?? Dizzy. I will create a new directory myself.
Mkdir-p/usr/local/jpeg/include
Mkdir-p/usr/local/jpeg/lib
Mkdir-p/usr/local/jpeg/bin
Mkdir-p/usr/local/jpeg/man/man1

OK, then the compilation is successful.

3. Check whether libpng is installed.
Rpm-qa libpng
If not, compile libpng and download it here.
./Configure -- prefix =/usr/local/png

Make & make install

4. Install the GD library. Download it here.
Tar-zxvf gd-2.0.35.tar.gz
Cd gd-2.0.35

./Configure -- prefix =/usr/local/gd2

5. Compile PHP and download it here
Tar-zxvf php-5.2.5.tar.gz
Cd php-5.2.5
. /Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql -- with-zlib -- with-jpeg-dir =/usr/local/jpeg -- with-png -dir =/usr/local/png -- with-freetype-dir =/usr/local/freetype -- enable-ftp -- enable-sockets -- with-gd =/usr/local/ gd2 -- enable-gd-native-ttf -- with-ttf -- enable-magic-quotes -- with-iconv-enable-mbstring = all
OK all done
PS: if an error occurs during installation:
Configure. ac: 64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Make: *** [configure] Error 1
Install gettext. Download it here.

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.