- [Root@jbxue ~]# Rpm-qa | grep zlib
- zlib-1.2.1.2-1.2
- zlib-devel-1.2.1.2-1.2
- You have new mail in/var/spool/mail/root
Copy CodeIf it does not exist, please download the compilation manually: Http://ishare.iask.sina.com.cn/f/15275772.html
- Tar zxvf zlib-1.2.2.tar.gz
- CD zlib-1.2.2
- ./configure
- Make
- Make install
Copy Code2, install libpng http://sourceforge.net/projects/libpng/
- Tar zxvf Libpng-1.4.2.tar.tar
- CD libpng-1.4.2
- ./configure
- Make
- Make install
Copy Code3. Install FreeType http://sourceforge.net/projects/freetype/
Tar zxvf freetype-2.3.12.tar.gz
- CD freetype-2.3.12
./configure
- Make
- Make install
Copy Code4. Install JPEG http://www.ijg.org/
Tar zxvf jpegsrc.v8b.tar.gz
- CD jpeg-8b/
./configure--enable-shared
- Make
- Make Test
- Make install
Copy CodeNote that this configure must take the--enable-shared parameter, otherwise the shared library will not be generated. 5, install GD https://bitbucket.org/pierrejoye/gd-libgd/downloads
Tar zxvf gd-2.0.33.tar.gz
- CD gd-2.0.33
- ./configure--with-png--with-freetype--with-jpeg
Make
- Make install
Copy Code6, install PHP php-5.2.11.tar.gz
Tar zxvf php-5.2.11.tar.gz
- CD php-5.2.11
- The./configure option is shown below
Make
- Make install
Copy CodeNote:
/usr/local/include/freetype2/freetype
- FreeType
/usr/local/include/include
- T1lig
/usr/local/include/libpng14/
- Png
/usr/local/include
- Jpeg
[Root@jbxue php-5.2.11]#./configure--help | grep t1lib
- --with-t1lib[=dir] Gd:include t1lib support. T1lib version >= 5.0.0 required
- [Root@jbxue php-5.2.11]#./configure--help | grep png
- --with-png-dir[=dir] Gd:set The path to libpng install prefix
- [Root@jbxue php-5.2.11]#./configure--help | grep jpeg
- --with-jpeg-dir[=dir] Gd:set The path to libjpeg install prefix
- [Root@jbxue php-5.2.11]#./configure--help | grep FreeType
- --with-freetype-dir[=dir] Gd:set the path to freetype 2 install prefix
- [Root@jbxue php-5.2.11]#
./configure--PREFIX=/OPT/PHP5--with-apxs2=/opt/apache/bin/apxs--with-mysql=/usr/local/mysql-- With-config-file-path=/opt/php5/lib--WITH-GD--with-zlib--with-png-dir=/usr/local/include/libpng14/-- With-jpeg-dir=/usr/local/include--with-freetype-dir=/usr/local/include/freetype2/freetype (--with-t1lib-- With-t1lib-dir=/usr/local/include/include)
Copy CodeFinally, only t1lib support is not enabled. The GD library support is finally as follows:
Listen 81
- #
- # Dynamic Shared Object (DSO) support
- #
- # to is able to use the functionality of a module which is built as a DSO you
- # The corresponding ' LoadModule ' lines at the
- # directives contained in it is actually available _before_ they is used.
- # statically compiled modules (those listed by ' httpd-l ') does not need
- # to is loaded here.
- #
- # Example:
- # LoadModule Foo_module modules/mod_foo.so
- LoadModule Php5_module modules/libphp5.so
AddType application/x-httpd-php. php
- AddType Application/x-httpd-php-source. Phps
- #
Copy CodeCreate a test file in the Htdocs directory info.php:
- [Root@jbxue apache]# Cat htdocs/info.php
- Echo Phpinfo ();
- ?>
Copy CodeThen, access the file in the browser to query the GD library support. |