-
- [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
If the copied code
does not exist, please download and compile it 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 the code
2, 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 code
3. 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 the code
4, install Jpeg http://www.ijg.org/
-
-
tar zxvf jpegsrc.v8b.tar.gz
- cd jpeg-8b/
./configure --enable-shared
- make
- make test
- make install
-
-
Copy code
Note that configure must have the --enable-shared parameter here, 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 p>
make
- make install
-
Copy code
6, install PHP php-5.2.11.tar.gz
-
-
tar zxvf php-5.2.11.tar.gz
- cd php-5.2.11
- ./Configure options are shown below
make
- make install< ;/p>
-
Copy code
Note:
-
-
/usr/local/include/freetype2/freetype
- freetype
/usr/local/include/include
- t1lig
- 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 code
In the end, only T1Lib Support is not enabled.
GD library support is finally as follows:
-
-
Listen 81
- #
- # Dynamic Shared Object (DSO) Support
- #
- # To be able to use the functionality of a module which was built as a DSO you
- # have to place corresponding `LoadModule' lines at this location so the
- # directives contained in it are actually available _before_ they are used.
- # Statically compiled modules (those listed by `httpd -l') do not need
- # to be 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 code
Create the test file info.php in the htdocs directory:
-
- [root@jbxue apache]# cat htdocs/info.php
- echo phpinfo();
- ?>
-
Copy the code
Then, visit it in the browser This file can be used to query the GD library support.
|