Chinaunix首页 | 论坛 | 博客
  • 博客访问: 319313
  • 博文数量: 78
  • 博客积分: 2611
  • 博客等级: 少校
  • 技术积分: 740
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-10 18:02
文章分类

全部博文(78)

文章存档

2014年(1)

2012年(1)

2011年(2)

2010年(8)

2009年(4)

2008年(14)

2007年(48)

我的朋友

分类: LINUX

2008-04-21 15:31:34

GD+PHP 

下载

gd-2.0.33.tar.gz

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 2561024

 

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

阅读(1088) | 评论(3) | 转发(0) |
0

上一篇:dd的经验教训

下一篇:聊聊抵制

给主人留下些什么吧!~~

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