Ubuntu Compile and install GD and PHP
In Ubuntu system apt-get install PHP and PHP-GD but because of the need to upgrade the GD library, the case, uninstall the original PHP compiled installation of the GD Library and PHP, and MySQL for apt-get installation
Compile and install GD 1, compiling and installingZlib
tar-zxf zlib-1.2.3. tar.gz
CD zlib-1.2.3/
./configure--prefix=/usr/local
Make && sudo make install
2. Compile and install PNG
TAR-ZXFlibpng-1.2.18. tar.gz
CDlibpng-1.2.18/
./configure--prefix=/usr/local/libpng
Make && sudo make install
3. Compile and install JPEG
TAR-ZXFjpegsrc.v9a. tar.gz
CDjpegsrc.v9a/
./configure--prefix=/usr/local
Make && sudo make install
4. Compile and install Libiconv
TAR-ZXFlibiconv-1.14. tar.gz
adblibiconv-1.14/
./configure--prefix=/usr/local
Make && sudo make install5. Compile and install FreeType
TAR-JXFfreetype-2.4.6. tar.bz2
CDfreetype-2.4.6/
./configure--prefix=/usr/local
Make && sudo make install
6. Compile and install GD Note: To specify the installation directory of GD to the directory example:/configure--prefix=/usr/local/gd
tar-zxf gd-2.0.33RC1.tar.gz
CD gd-2.0.33rc1/
./configure--prefix=/usr/local/gd--with-png=/usr/local--with-freetype=/usr/local--with-jpeg9a=/usr/local
Make && sudo make install
7. Compile and install PHP5.4.4
Tar XF php-5.4.4.tar.gz
CD php-5.4.4 MySQL for apt-get installation
./configure--prefix=/usr/local/php--enable-fpm--enable-sockets--enable-sysvshm--enable-mbstring-- With-freetype-dir--with-jpeg9a-dir=/usr/local/jpeg9a--with-png-dir--with-zlib-dir--with-libxml2-dir=/usr/local /LIBXML2--enable-xml--with-mhash--with-config-file-path=/etc--with-config-file-scan-dir=/etc/php.d--with-curl- -WITH-GD--with-mysql
To avoid the occurrence
ext/iconv/.libs/iconv.o:in function ' php_iconv_stream_filter_ctor ':
/home/king/php-5.2.13/ext/iconv/iconv.c:2491:undefined reference to ' Libiconv_open '
Collect2:ld returned 1 exit status
Make : * * * [sapi/cli/php] Error 1the problem
Modify a fileVI Makefilein the installationPHPto the system when it happens "undefined reference to Libiconv_open '"error message, which means"./configure"Do not grasp some of the environmental variable values. The error occurred at the point of establishing "- o sapi/cli/php"is wrong, did not give toLinkof theIconvfunction library parameters. Workaround: EditMakefileabout thethe place around the line: extra_libs = ...-lcryptat the end add-liconv, such as: extra_libs = ...-lcrypt-liconv
Make && make install
This article is from the "Ubuntu compiled GD and php" blog, please be sure to keep this source http://6158535.blog.51cto.com/6148535/1690253
Ubuntu compilation installation GD and PHP