Introduction: This is a detailed page for installing the GD library in Linux. It introduces the knowledge, skills, experience, and some PHP Source Code related to installing the GD library in PHP, Gd, and PHP Linux.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 347705 'rolling = 'no'>
2.5. Added GD support
There are two methods to add GD support. One is that when the system comes with GD, you can use the initial installation method. For details, see section 2.1 (3). The other is to install the GD third-party plug-in, the procedure is as follows:
(1) download the following packages:
Jpegsrc.v6b.tar.gz
Libpng-(version).tar.gz
Freetype-(version).tar.gz
Gettext-(version).tar.gz
Gd-(version).tar.gz
(2) install the jpeg-6b (JPEG supported ):
(2.1) run the following command to create a directory:
Mkdir-P [jpeg-6b installation directory] mkdir-P [jpeg-6b installation directory]/bin/mkdir-P [jpeg-6b installation directory]/lib/mkdir-P [jpeg-6b installation directory]/include /mkdir-P [jpeg-6b installation directory]/man/mkdir-P [jpeg-6b installation directory]/man/Man1/
(2.2) decompress "src.v6b.tar.gz"
(2.3) Go to the [jpeg-6b unzip Directory] and run the following command to replace the file:
CP/usr/share/libtool/config. sub. CP/usr/share/libtool/config. Guess.
(2.4) Go to the [jpeg-6b unzip Directory] and execute the following command to install the jpeg-6b:
./Configure -- prefix = [jpeg-6b installation directory] -- enable-shared -- enable-staticmakemake install
(3) install libpng (PNG supported ):
Decompress libpng-(version).tar.gz, go to the [libpng extract Directory], and run the following command to install libpng:
./Configure -- prefix = [libpng installation directory] -- enable-shared -- enable-staticmakemake install
(4) install FreeType:
Decompress freetype-(version).tar.gz, go to the [FreeType extract Directory], and run the following command to install FreeType:
./Configure -- prefix = [FreeType installation directory] Makemake install
(5) install gettext (Gd installation may be required ):
Decompress gettext-(version).tar.gz to enter the [gettext extract Directory] and run the following command to install gettext:
./Configure -- prefix = [gettext installation directory] Makemake install
(6) install GD:
Decompress gd-(version).tar.gz, go to the [Gd extract Directory] and execute the following command to install GD:
. /Configure -- prefix = [Gd install directory] -- With-JPEG = [jpeg-6b install directory] -- With-PNG = [libpng install directory] -- With-FreeType = [FreeType install directory] -- With-gettext = [gettext installation directory] (for example. /configure -- prefix =/opt/gd-2.0.35 -- With-JPEG =/opt/jpeg-6b/-- With-PNG =/opt/libpng-1.2.35/-- With-FreeType =/opt/freetype-2.3.5 /-- with-gettext =/opt/gettext-0.17 /) makemake install
If
Configure. AC: 64: Error: Possibly undefined macro: am_iconvif this token and others are legitimate, please use m4_pattern_allow.see the Autoconf documentation.
check whether libattr. a In the/usr/lib directory is gray and has no permission. If you enter the following command
chmod 777 libattr. A
(7) add GD to PhP
(7.1) initial compilation and installation
. /configure command append the following content -- With-JPEG = [jpeg-6b installation directory] -- With-PNG = [libpng installation directory] -- With-FreeType = [FreeType installation directory] -- With-gettext = [gettext installation directory] -- With-Gd = [Gd installation directory]
(e.g. /configure -- With-config-file-Path =/opt/PHP -- prefix =/opt/PHP -- with-bz2 -- enable-zip -- enable-mbstring -- with-apxs2 =/opt/apache2/ bin/apxs -- With-zlib-Dir =/usr/include/-- With-libxml-Dir =/usr/lib64/-- With-JPEG-Dir =/opt/jpeg-6b -- -PNG-Dir =/opt/libpng-1.2.35 -- With-FreeType-Dir =/opt/freetype-2.3.5 -- With-gettext =/opt/gettext-0.17 -- With-Gd =/opt/gd-2.0.35 -- enable -Soap -- enable-calendar)
for detailed steps, refer to (3) of 2.1
(7.2) append compilation and installation
go to the "[PHP extract Directory]/EXT/GD" directory and execute the following command:
[PHP installation directory]/bin/phpize
. /Configure -- With-PHP-Config = [PHP installation directory]/bin/PHP-config -- With-JPEG = [jpeg-6b installation directory] -- With-PNG = [libpng installation directory] -- With-FreeType = [FreeType installation directory] -- With-gettext = [gettext installation directory] -- With-Gd = [Gd installation directory] Makemake install
After the installation is successful, the GD. So file is generated under the [PHP installation directory]/lib/PHP/extensions/no-debug-non-zts-20060613 directory,
Then CP [PHP installation directory]/lib/PHP/extensions/no-debug-non-zts-20060613/GD. So/opt/PHP/EXT
(7.3) Modify PHP. the INI file loads the GD component and adds extension_dir =/opt/PHP/EXT and extension = Gd. so. If extension_dir =/opt/PHP/EXT exists, you do not need to add
Extension_dir =/opt/PHP/extextension = Gd. So
Modify the php. ini file in the same way as 2.3.
If the append compilation is unsuccessful, use the initial compilation. For more information, see section 3 of 2.1)
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/347705.html pageno: 3