Install gd (freetype, jpeg, png, and zlib) in php)

Source: Internet
Author: User
Tags crc32
Gd (freetype, jpeg, and png) is required for php installation) support 1. install freetype [root @ localhostsofts] tarxffreetype-250tarbz2-Cusrsrc [root @ localhostsofts] cdusrsrcfreetype-250 [r install php requires gd (freetype, jpeg, png) support 1. install freetype [root @ localhost softs] # tar xf freetype-2.5.0.tar.bz2-C/usr/src/[root @ localhost softs] # cd/usr/src/freetype-2.5.0 [root @ localhost freetype-2.5.0] #. /configure -- prefix =/usr/local/freetype -- enable-shared [root @ localhost Freetype-2.5.0] # make & make install 2, install png [root @ localhost softs] # tar xf libpng-1.6.6.tar.gz-C/usr/src/[root @ localhost softs] # cd/usr/ src/libpng-1.6.6/[root @ localhost libpng-1.6.6] #. /configure -- prefix =/usr/local/png -- enable-shared [root @ localhost libpng-1.6.6] # make & make install 3. install jpeg [root @ localhost softs] # tar xf jpeg-6b.tar.gz-C/usr/src/[root @ localhost softs] # cd/usr/src/jpeg-9/ [Root @ localhost jpeg-9] #. /configure -- prefix =/usr/local/jpeg -- enable-shared [root @ localhost jpeg-9] # make & make install 4, install zlib [root @ localhost softs] # tar xf zlib-1.2.2.2.tar.gz-C/usr/src/[root @ localhost softs] # cd/usr/src/zlib-1.2.2.2 [root @ localhost zlib-1.2.2.2] #. /configure -- prefix =/usr/local/zlib [root @ localhost zlib-1.2.2.2] # make & make install 5, install libgd [root @ localhost softs] # tar xf Libgd-2.1.0.tar.xz-C/usr/src/[root @ localhost softs] # cd/usr/src/libgd-2.1.0/[root @ localhost libgd-2.1.0] #. /configure -- prefix =/usr/local/gd -- enable-shared -- with-jpeg =/usr/local/jpeg -- with-freetype =/usr/local/freetype --- png =/usr/local/png -- with-zlib =/usr/local/zlib the following error occurs when compiling the gd-2.0.33.tar.gz: /usr/bin/ld:/usr/local/lib/libz. a (compress. o): relocation R_X86_64_32 against 'a local symb Ol 'can not be used whenmaking a shared object; recompile with-fPIC/usr/local/lib/libz. a: cocould not read symbols: Bad valuecollect2: ld returned 1 exit statusmake [2]: *** [libgd. la] Error 1 make [2]: Leaving directory '/usr/local/src/gd-2.0.33 'make [1]: * ** [all-recursive] Error 1 make [1]: Leaving directory '/usr/local/src/gd-2.0.33' make: *** [all] error 2 work2 und: reinstall zlib-1.2.3.tar.gz [root @ unix-server1 zlib- 1.2.3] # sudo CFLAGS = "-O3-fPIC ". /configure -- prefix =/usr/local/zlib/Checking for gcc... building static library libz. a version 1.2.3 with gcc. checking for unistd. h... yes. checking whether to use vs [n] printf () or s [n] printf ()... using vs [n] printf () Checking for vsnprintf () in stdio. h... yes. checking for return value of vsnprintf ()... yes. checking for errno. h... yes. checking for mmap support... yes. [r Oot @ unix-server1 zlib-1.2.3] # makegcc-O3-fPIC-DUSE_MMAP-c-o example. o example. cgcc-O3-fPIC-DUSE_MMAP-c-o adler32.o adler32.cgcc-O3-fPIC-DUSE_MMAP-c-o compress. o compress. cgcc-O3-fPIC-DUSE_MMAP-c-o crc32.o crc32.cgcc-O3-fPIC-DUSE_MMAP-c-o gzio. o gzio. c gcc-O3-fPIC-DUSE_MMAP-c-o uncompr. o uncompr. cgcc-O3-fPIC-DUSE_MMAP-c-o deflate. o deflate. cgcc-O3-fPIC-DUSE_MMA P-c-o trees. o trees. cgcc-O3-fPIC-DUSE_MMAP-c-o zutil. o zutil. cgcc-O3-fPIC-DUSE_MMAP-c-o inflate. o inflate. cgcc-O3-fPIC-DUSE_MMAP-c-o infback. o infback. cgcc-O3-fPIC-DUSE_MMAP-c-o inftrees. o inftrees. cgcc-O3-fPIC-DUSE_MMAP-c-o inffast. o inffast. car rc libz. a adler32.o compress. o crc32.o gzio. o uncompr. o deflate. o trees. o zutil. o inflate. o infback. o inftrees. o inffast. ogcc -O3-fPIC-DUSE_MMAP-o example. o-L. libz. agcc-O3-fPIC-DUSE_MMAP-c-o minigzip. o minigzip. cgcc-O3-fPIC-DUSE_MMAP-o minigzip. o-L. libz. a [root @ unix-server1] # make installcp zlib. h zconf. h/usr/local/zlib // includechmod 644/usr/local/zlib // include/zlib. h/usr/local/zlib // include/zconf. hcp libz. a/usr/local/zlib/libcd/usr/local/zlib/lib; chmod 755 libz. acd/us R/local/zlib // lib; if test-f libz. so.1.2.3; then \ rm-f libz. so libz. so.1; \ ln-s libz. so.1.2.3 libz. so; \ ln-s libz. so.1.2.3 libz. so.1; \ (ldconfig | true)>/dev/null 2> & 1; \ ficzlib.3/usr/local/zlib // share/man/man3chmod 644/usr/local/zlib // share/man/man3/zlib.3 [root @ unix-server1 zlib-1.2.3] # make cleanrm-f *. o *~ Example minigzip \ libz. * foo.gz so_locations \ _ match. s maketree contrib/infback9 /*. o [root @ localhost libgd-2.1.0] #. /configure -- prefix =/usr/local/gd -- enable-shared -- with-jpeg =/usr/local/jpeg -- with-freetype =/usr/local/freetype --- png =/usr/local/png -- with-zlib =/usr/local/zlib [root @ localhost libgd-2.1.0] # make & make install 6. reconfigure the file [root @ localhost libgd-2.1.0] # echo "/usr/local/mysql/lib">/etc/ld. so. conf [root @ localhost libgd-2.1.0] # ldconfig 7, install php [root @ localhost softs] # tar xf php-5.3.27.tar.gz-C/usr/src/[root @ localhost softs] # cd/usr /src/php-5.3.27/[root @ localhost php-5.3.27] #. /configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- disable-ipv6 -- with-libxml-dir =/usr -- with-openssl =/usr -- with-zlib =/usr -- with-bz2 =/usr -- with-curl =/usr -- enable-ftp -- with-mysql =/usr/local/mysql -- with-mysql-sock =/var/run/mysqld /mysql5.socket -- with-mysqli =/usr/local/mysql/bin/mysql_config -- enable-bcmath -- enable-mbstring -- enable-sockets -- with-gd -- with-jpeg-dir = /usr/local/jpeg/-- with-png-dir =/usr/local/png/-- with-freetype-dir =/usr/local/freetype -- with-zlib-dir =/usr/local/zlib/-- with-zlib [root @ localhost php-5.3.27] # make & make install 8, view all php support modules [root @ localhost lib] # php -m [PHP Modules] Modules

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.