First, install directly
Yum Install PHP-GD
Two, do not recompile PHP, add GD extension
1. First compile and install GD library
Http://google-desktop-for-linux-mirror.googlecode.com/files/gd-2.0.35.tar.gz
Cd/usr/local/src
TAR-ZXVF gd-2.0.35.tar.gz
Mkdir-p/USR/LOCAL/GD
CD gd-2.0.35
./configure--prefix=/usr/local/gd--enable-m4_pattern_allow--with-jpeg=/usr/local/jpeg9--with-png--with-zlib- With-freetype=/usr/local/freetype--with-libmcrypt=/usr/local/libmcrypt
Make
Make install
2, into the "[PHP Extract directory]/ext/gd" directory, to expand the add
Execute the following command:
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config-with-jpeg=/usr/local/jpeg9--with-png=/usr/local/ Libpng--with-freetype=/usr/local/freetype--with-zlib=/usr/local/zlib--WITH-GD=/USR/LOCAL/GD
Make time,
/usr/include/ft2build.h:56:38:error:freetype/config/ftheader.h:no such file or directory
/usr/local/src/php-5.3.28/ext/gd/gd.c:83:12:error: #include expects "FILENAME" or
Make: * * * [Gd.lo] Error 1
Solution:
Ln-s/usr/include/freetype2/freetype//usr/include/freetype
Problem resolution, continue installation:
[root@ay140404104215567249z gd]# make install
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files:/usr/local/php/include/php/
The extension was added successfully.