cd zlib-1.2.3
./configure
make
make install
cd libpng-1.2.8
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个
cd freetype-2.1.10
./configure
make
make install
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库
cd gd-2.0.33
./configure --with-png --with-freetype --with-jpeg
make
make install
修改Makefile文件,使得:
CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
此后,编译并安装:
make
make install
命令完成后,gd.h被拷到/usr/local/lib目录下,libgd.a被拷到/usr/local/lib目录下。
cd php-5.2.2
[root@s10 php-5.2.2]# ./configure --prefix=/opt/php --with-apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql --with-gd=/usr/local/lib --with-zlib --with-png --with-jpeg --with-freetype --enable-sockets --enable-track-vars
make
make install
?>