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.