Add GD library support for php

Source: Internet
Author: User
Tags file info
Add GD library support for php 1. install zlib, General Centos system has been installed, you can use the following command to view: [root @ Test-Web2 ~] # Rpm-qa | grepzlibzlib- [ro added GD library support for php

1. install zlib. Generally, the Centos system has been installed. you can run the following command to check the installation:

[Root @ Test-Web2 ~] # Rpm-qa | grep zlib
You have new mail in/var/spool/mail/root
[Root @ Test-Web2 ~] #

If there is no need to install, there is no need to manually download the compilation:

Tar zxvf zlib-1.2.2.tar.gz (version pick yourself, no so-called)
?? Cd zlib-1.2.2
??. /Configure
?? Make?
?? Make install

2. install libpng


Tar zxvf libpng-1.4.2.tar.tar
?? Cd libpng-1.4.2
?? Make
?? Make install

3. install freetype


Tar zxvf freetype-2.3.12.tar.gz
?? Cd freetype-2.3.12

??. /Configure
? Make
?? Make install

4. install Jpeg


? Tar zxvf jpegsrc.v8b.tar.gz
?? Cd jpeg-8b/

??. /Configure -- enable-shared
?? Make
?? Make test
?? Make install
Note: Here, configure must include the -- enable-shared parameter. Otherwise, the shared library will not be generated.

5. install GD


GD-2.44.tar.gz is not installed, ^ _ ^


Tar zxvf gd-2.0.33.tar.gz?
?? Cd gd-2.0.33
??. /Configure -- with-png -- with-freetype -- with-jpeg

?? Make install

6. install PHP


? Tar zxvf php-5.2.11.tar.gz
?? Cd php-5.2.11
??. /Configure options are shown below

? Make
?? Make install






[Root @ Test-Web2 php-5.2.11] #./configure -- help | grep t1lib
? -- With-t1lib [= DIR] ??? GD: Include T1lib support. T1lib version> = 5.0.0 required
[Root @ Test-Web2 php-5.2.11] #./configure -- help | grep png
? -- With-png-dir [= DIR] ??? GD: Set the path to libpng install prefix
[Root @ Test-Web2 php-5.2.11] #./configure -- help | grep jpeg
? -- With-jpeg-dir [= DIR] ??? GD: Set the path to libjpeg install prefix
[Root @ Test-Web2 php-5.2.11] #./configure -- help | grep freetype
? -- With-freetype-dir [= DIR] GD: Set the path to FreeType 2 install prefix
[Root @ Test-Web2 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)

Finally, only T1Lib Support is not enabled.

The GD Library supports the following:

GD Support? Enabled ??
GD Version? Bundled (2.0.34 compatible )??
FreeType Support? Enabled ??
FreeType Linkage? With freetype ??
FreeType Version? 2.3.12 ??
GIF Read Support? Enabled ??
GIF Create Support? Enabled ??
JPG Support? Enabled ??
PNG Support? Enabled ??
WBMP Support? Enabled ??
XBM Support? Enabled


Add the following content to the apache configuration file:

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
# 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/
LoadModule php5_module ??????? Modules/

AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps


Create the following file info. php in the htdocs folder

[Root @ Test-Web2 apache] # cat htdocs/info. php?
? Echo phpinfo ();
[Root @ Test-Web2 apache] #

Query the status supported by the GD database.

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: 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.