分类: LINUX
2008-04-21 15:31:34
GD+PHP
下载
gd-
jpegsrc.v6b.tar.gz
libpng-1.2.7.tar.tar
zlib-1.2.2.tar.gz
freetype-2.1.9.tar.gz
php-4.3.9.tar.gz
二、说明
最新的GD库包括了对GIF的支持,所以不要打GIF补丁
安装步骤:
先安装zlib,freetype,libpng,jpeg,再装GD,再装PHP
三、安装
1.装zlib
tar zxvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
./configure
make
make install
2.安装libpng
tar zxvf libpng-1.2.7.tar.tar
cd libpng-1.2.7
cd scripts/
mv makefile.linux ../makefile
cd ..
make
make install
注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个
3.安装freetype
tar zxvf freetype-2.1.9.tar.gz
cd freetype-2.1.9
./configure
make
make install
4.安装Jpeg
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库
5.安装GD
tar zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --with-png --with-freetype --with-jpeg
make install
6.安装PHP
tar zxvf php-5.2.0.tar.gz
cd php-5.2.0
./configure --prefix=/usr/local/php-5.2.0 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-zlib --with-png-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-sockets --with-curl --with-sqlite --with-iconv
make
make install
cp php-dist.ini /usr/local/php5.2.0/lib/php.ini
找不到mysql头文件支持的,需要安装mysql-devel包,查找mysql.h的位置,一般会在/usr/include/mysql/ 下面
7.配置Apache支持PHP(看是否为work模式)
修改httpd-2.2.3/server/mpm/prefork/prefork.c中关于define DEFAULT_SERVER_LIMIT 256为1024
tar xzvf http-2.2.3.tar.gz
cd http-2.2.3
./configure --prefix=/usr/local/apache2 --enable-rewrite --enable-cgi --enable-http --enable-headers –enable-so
Make
make install
8.测试
php -r ' phpinfo(); '| more
chinaunix网友2010-04-16 13:32:56
关于mysql报错的,有好多,也是64bit的,如果默认安装了mysql-devel,需要在/usr/lib下做个链接 cd /usr/lib ; ln -s /usr/lib64/mysql .。如果mysql安装devel包,需要安装。记得生成的好像静态的,不会生成so,想起来再加吧。
chinaunix网友2010-04-16 13:26:04
安装jpeg出错,基本上都是64bit系统的, 把 /usr/share/libtool/config.guess 覆盖到相关软件自带的config.guess 把 /usr/share/libtool/config.sub 覆盖到相关软件自带的config.sub
chinaunix网友2010-04-16 13:25:07
在安装 php 时,需要先安装 gd-2.0.33.tar.gz , 但在编译 gd-2.0.33.tar.gz 时出现了如下错误: /usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [libgd.la] 错误 1 make[2]: Leaving directory `/usr/local/src/gd-2.0.33' make[1]: *** [all-recursive] 错误 1 make[1]: Leaving directory `/usr/local/src/gd-2.0