For PHP + MySQL + Apache packaged with rpm, the GD library is installed by default.
If you want to compile and install these files, you must install the GD library by yourself.
I compile and install (Source code) Apache + PHP. The GD library is used now, so the GD library is installed again.
I found a lot of information on the Internet, which is neither detailed nor outdated.
After reading some documents, I finally finished it. Now I will summarize it.
Run the following command under red hat linux 9.0 + Apache + PHP.
Powered by aspbiz (AT) 163.com
For the original text or updates, see my blog:
Http://blog.chinaunix.net/index.php? Blogid = 724
1. Download
Gd-2.0.33.tar.gz http://www.boutell.com/gd/
Jpegsrc.v6b.tar.gz http://www.ijg.org/
Libpng-1.2.7.tar.tar http://sourceforge.net/projects/libpng/
Zlib-1.2.2.tar.gz http://sourceforge.net/projects/zlib/
Freetype-2.1.9.tar.gz http://sourceforge.net/projects/freetype/
Php-4.3.9.tar.gz http://www.php.net
Ii. Description
The latest GD library supports GIF, so do not apply GIF patches.
Http://sourceforge.net/good multi-sourceCodeThe package can be found above
Installation steps:
Install zlib, FreeType, LibPNG, JPEG, Gd, and PHP first.
Iii. Installation
1. Install zlib
Tar zxvf zlib-1.2.2.tar.gz
CD zlib-1.2.2
./Configure
Make
Make install
2. Install libpng
Tar zxvf libpng-1.2.7.tar.tar
CD libpng-1.2.7
CD scripts/
MV makefile. Linux ../makefile
CD ..
Make
Make install
Note that the makefile here is not generated using./configure, but copied directly from the scripts/
3. Install FreeType
Tar zxvf freetype-2.1.9.tar.gz
CD freetype-2.1.9
./Configure
Make
Make install
4. Install JPEG
Tar zxvf restart src.v6b.tar.gz
CD jpeg-6b/
./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
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-4.3.9.tar.gz
CD php-4.3.9
. /Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- With-mysql -- With-Gd -- With-zlib -- With-PNG -- With-JPEG -- With-FreeType -- enable-sockets
Make
Make install
7. Configure Apache to support PHP
8. Test
<? PHP
Phpinfo ();
?>;
OK .....