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-1.2.1.2-1.2zlib-devel-1.2.1.2-1.2Youhavenewmailinvarspoolmailroot [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
Zlib-1.2.1.2-1.2
Zlib-devel-1.2.1.2-1.2
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: http://sourceforge.net/projects/zlib/

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

Http://sourceforge.net/projects/libpng/

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

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

4. install Jpeg

Http://www.ijg.org/

? 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

Http://download.chinaunix.net/download/0004000/3479.shtml

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

Gd-2.0.33.tar.gz

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

Make
?? Make install

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

Note:

/Usr/local/include/freetype2/freetype
Freetype

/Usr/local/include
T1lig

/Usr/local/include/libpng14/
Png

/Usr/local/include
Jpeg

[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
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/mod_foo.so
LoadModule php5_module ??????? Modules/libphp5.so

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