Implementing large maps in PHP automatically shrinks small maps (installation of GD))
First, install the GD library: 1. Environment: Windows2000Server PHP4.0.4 GD IIS is easy to install in Windows, in the PHP4.0 or above, ready to bring the dynamic link library in the PHP4 / Extensions directory: php_gd.dll. As long as it is in php.ini; extension = php_gd.dll front; remove, then follow WebServer (IIS or Apache), it will be. Running a PHP program with Phpinfo ();?>, There is an explanation that you can use: GD GD Support Enabled GD VERSION 1.6.2 or Higher Freetype Support Enabled Freetype Linkage With TTF Library JPG Support Enabled PNG Support Enabled WBMP Support Enabled In addition, there is a php_gd_gif.dll on the Internet to download it, and it is renamed PHP_GD.DLL overwrites the original file, restart IIS, you can implement a GIF library. To http://php.weblogs.com/php_gd download PHP_GD_404.zip, decompress the above operation. This is for php4.0.4, other versions of PHP cannot be used, (the old board PHP4.0.0 can download php_gd_gif.zip). Oh, your PHPINFO () will display a GIF Support Enabled more, but it is related to copyright issues. In the Linux GD library, you will be more troublesome, first simply talk about Apache and PHP installation: When we install PHP in the Apache environment, you have three installation modes to choose from: static modules, dynamic modules (DSO) and CGI. Commonly used is a static module, which is compiled together in Apache and PHP, so that PHP performs high efficiency, but PHP is to upgrade or want to install additional libraries in the GD library, it is necessary to recompile both. The dynamic module is better, and the PHP is re-compiled separately, and the install file in the PHP is installed. I spent a half-day installation successfully, introducing a little static module plus GD library JPEG PNG experience: 2. Environment: Linux6.1 php4.0.6 GD1.8.4 JPEG PNG ZLIB Apache_1.3.20 mysql 1) Download Required library: Download the GD library: It is recommended to use the Version 1.8.4 (Stable) stabilization, I compile GD-2.0.1 (beta), I have not passed. Http://www.boutell.com/gd/ Download Zlib: http://www.info-zlib/pub/infozip/zlib/ Download libPng: It is recommended to use libpng-1.0.6-1-src.tar. GZ http://www.turbolinux.com.cn/pub/mirrors/sourceware/cygwin/contrib/libpng/ Download jpegsrc.v6b.tar.gz: http://www.turbolinux.com.cn/pub/mirrors/ GNU / GHOSTScript / The following steps need to be performed in order: 2) I use Linux6.1, the kernel is 2.2.12.
Enter ROOT, unzip all packages, tar -zxvf filename. Then compile: 3) If your Linux is not installed, Zilb must be installed, enter ZLIB-1.1.3 execution: ./configure make make install 4) Enter libpng-1.0.6, can be installed under Linux, or DOS, Under Linux, you need to copy his Makefile file, execute: CP scripts / makefile.linux makefile make make install 5) Enter JPEG-6B Execution: ./configure make make install 6a) Enter GD-1.8.4 Modify Makefile Check GD library Whether to join JPEG support to modify the Makefile file. Modify the makefile file, make: cflags = -o -dhave_libpng -dhave_libjpeg libs = -lgd -lpng -lz -lm -ljpeg or, if you are installed if FreeType, XPM, TTF is installed, (the installation method is similar to the same, go to the library bar), changed to the following: # CFLAGS = -O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG # -DHAVE_LIBFREETYPE -DHAVE_LIBTTF # LIBS = -lgd -lpng -lz -ljpeg -lfreetype -lm -lttf # removed Thereafter, compile and install: make make Install (if you need mysql, you are not installed, first install mysql, unzip, execute: ./configure; make; make install ./configure --prefix = / home / mysql, default installation path / usr / local / share / Mysql.
) 7) Re-build PHP, I use PHP-4.0.6, it is best to look at the installation file, more install, then execute: 7.1) Unzip into apache_1.3.20, you need to test some files, execute: ./configure --prefix = / home / apache --activate-module = src / modules / php4 / libphp4.a 7.2) Unzip into PHP-4.0.6, compile installation: ./configure --with-mysql --with-apache = ../apache_1.3.20 --with-gd = .. / GD-1.8.4 --With-jpeg-dir = .. / jpeg-6b --with-png-dir = .. / libpng-1.0.6 --with-zlib --enable-track-var (default installation path: / usr / local / lib / php) 8) If your PHP is compiled with Apache, you must recompile Apache, I use Apache_1.3.20 stop apache: ./ Home / Apache / Bin / Apachectl Stop Enter Apache_1.3.20, need to change file SRC / Configuration: Add: addModule modules / php4 / libphp4.a [this is apache_1.3.x Installation, if you use apache_1.2.x, add the module php4_module mod_php4.o and copy libphp4.module to SRC, modify the corresponding statement as: extra_libs = -l. -LPHP4 -LGDBM-LDB -L / USR / Local / mysql / lib -lmysqlclient If you use dynamic module installation, if you are the first installation, modify the statement, check the PHP's Insatll file. ] Then execute: ./configure --prefix = / home / apache (prefix = is specified). Do not take prefix, the default is / usr / local / apache) (can also be performed directly ./configure --prefix = / Home / apache --activate-module = src / modules / php4 / libphp4.a) Make make install 9) Enter PHP-4.0.6 to perform cp php.ini-dist /usr/local/lib/php.ini 10) startup Apache: ./home/apache/bin/apachectl start 11) Run your phpinfo () program, the default Apache root directory is / usr / local / apache / htdocs /. As shown in Windows above, Congratulations, you can support the installation, you can support PHP GD JPEG PNG. If you don't work, try it.