Author information: Nintendo (
)
Article Information: Primary Atmosphere Date: 2001 02 Keywords: GD
Source link:
http://www.chinalin ket.com/read.htm?id=272
Summary:
This article is intended to introduce the installation of the image processing support under PHP. After installation, PHP supports the image of GIF, PNG, JPEG, WBMP, and the specific installation setting step of PHP Please refer to the corresponding tutorial.
First, the installation under Windows:
Image of windows support is very simple, at the site http://www.php4win.de/
The downloaded PHP contains all the image support, where PHP_GD.DLL does not support GIF format, php_gd_gif.dll
Support all of the above formats, you need to support the above four formats, only PHP_GD_GIF.DLL is required to overwrite php_gd.dll
I.e.
After installation, use Phpinfo ();?> View the results are as follows:
GD
GD Support Enabled
GD Version 1.6.2 or Higher
FreeType Support enabled
Freetype Linkage with TTF Library
GIF support enabled
JPG Support Enabled
PNG Support enabled
WBMP Support Enabled
Second, the installation under UNIX / Linux
Unix installation is more troublesome, following the latest PHP 4.0.4PL1 as an example of Solaris 7 GD-1.8.3
Contains the installation of GIF support.
System environment: Solaris 7, GCC 2.9.2, Make 3.78.1, Bison 1.2.8
JPEG-6B installation:
File name: JPEG-6B-SOL7-SPARC-local.gz
Version: 6b
Download Sedum: http://www.sunfreeware.com/
Download location: ftp://ftp.sunfree.com/pub/freeWare/sparc/7/jpeg-6b-sol7-sparc-local.gz
Installation method: / usr / local / bin / gzip -d JPEG-6B-SOL7-SPARC-local.gz
PKGADD -D JPEG-6B-SOL7-SPARC-LOCAL
ZLIB installation:
File Name: Zlib-1.1.3-Sol7-sparc-local.gz
Version: 1.1.3
Download Sedum: http://www.sunfreeware.com/
Download Location: ftp://ftp.sunfreeWare.com/pub/freeWare/sparc/7/zlib 1.1.3-sol7-sparc-local.gz
Installation method: / usr / local / bin / gzip -d zlib-1.1.3-Sol7-sparc-local.gz
Pkgadd -d zlib-1.1.3-sol7-sparc-local
Libpng installation:
File name: libpng-1.0.2-sol7-sparc-local.gz
Version: 1.0.2
Download Sedum: http://www.sunfreeware.com/
Download Location: ftp://ftp.sunfreeWare.com/pub/freeWare/sparc/7/libpng-1.0.2-sol7-sparc-local.gz
Installation method: / usr / local / bin / gzip -d libpng-1.0.2-sol7-sparc-local.gzpkgadd -d libpng-1.0.2-sol7-sparc-local
XPM installation:
File Name: XPM-3.4K-SOL7-SPARC-local.gz
Version: 3.4
Download Sedum: http://www.sunfreeware.com/
Download Location: ftp://ftp.sunfreeWare.com/pub/freeware/sparc/7/xpm-3.4k-sol7-sparc-local.gz
Installation method: / usr / local / bin / gzip -d xpm-3.4k-sol7-sparc-local.gz
PKGADD -D XPM-3.4K-SOL7-SPARC-LOCAL
FreeType installation:
File name: freetype-1.3.1.tar.gz
Version: 1.3.1
Download Site: http://freeetype.sourceforge.net/
Download Location: ftp://freetype.sourceforge.net/pub/freetype/freeetype1/freeetype-1.3.1.tar.gz
Installation method: / usr / local / bin / gzip -d CD Freetype-1.3.1 ./configure Make Make Install T1LIB installation: File name: T1LIB-1.0.1.tar.gz Version: 1.0.1 Download Sedum: ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/pub/software/t1lib/ Download location: ftp://ftp.neuroinform.ruhr-uni-bochum.de/pub/software/t1lib/t1lib-1.0.1.tar.gz Installation method: / usr / local / bin / gzip -d CD T1-1.0.1 ./configure Make Make Install GD installation: File name: GD-1.8.3GIF.TAR.GZ Version: 1.8.3 Download Sedum: http://www.rime.com.au/gd/ Download location: ftp: //ftp.rhyme.com.au/pub/gd/gd-1.8.3gif.tar.gz Installation method: / usr / local / bin / gzip -d CD GD-1.8.3 ./configure (Edit Makefile File) CFLAGS = -O is cflags =--d =_XPM -DHAVE_JPEG -DHAVE_LIBTTF Change libs = -lm -lgd -lpng -lz for libs = -lm -lgd -lpng -lz -ljpeg -lttf -lxpm -lx11 Change includeIRS = -i. -I / usr / local / include -i / usr / include / x11 -i / usr / x11r6 / include / x11 Includedirs = -i. -I / usr / local / include -i / usr / include / x11 -i / usr / x11r6 / include / x11 -i / usr / local / include / freetype) Make Make Install PHP installation: File name: PHP-4.0.4pl1.tar.gz Version: 4.04 Patch Level 1 Download Sedum: http://www.php.net/ Download Location: http://www.php.net/do_download.php? Download_File = PHP-4.0.4pl1.tar.gz & Source_site = www.php.net Installation method: / usr / local / bin / gzip -d ./configure --with-apache = .. / Apache_1.3.17 --with-gd = / usr / local / --With-jpeg-dir = / usr / local --with-xpm-dir = / usr / local / --With-TTF = / usr / local / freetype --with-t1lib = / usr / local / --with-zlib = / usr / local --with-Tiff-Dir = / usr / local / --with-png-dir = / usr / local (Editor EXT / GD / GD.C Looking for #ifndef USE_GD_IOCTX to join #define gdimagecreatefromgiftx null Replace_php_image_create_from (INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", GDIMAGECREATEFROMG, NULL; To _php_image_create_from (internal_function_param_passthru, php_gdimg_type_gif, "gif", digagecreatefromgif, gdimagecreatefromgiftx); ) Make Make Install You can add PHP compilation options to meet your own needs, and the installation under Linux is similar. After installation, use Phpinfo ();?> View the results are as follows: GD GD Support Enabled GD Version 1.6.2 or Higher FreeType Support enabled Freetype Linkage with TTF Library T1LIB Support enabled GIF support enabled JPG Support Enabled PNG Support enabled WBMP Support Enabled I hope that you can help you with you.