Ubuntu compilation installation GD and PHP

Source: Internet
Author: User
Tags sapi

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

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.