注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发PHP → 文章内容

Linux主机重编译PHP支持GD库

作者:佚名 来源:不详 发布时间:2007-11-29 20:47:52

  *注意:请确认以下您服务器中Apache的安装路径,如果不是
/usr/local/apache2,则在进行以下安装操作时,
注意修改Apache的安装路径!

1、以root身份登录Linux主机;

2、停止Web Server服务,如果使用的是Apache可以通过以下命令停止:
shell> /usr/local/apache2/bin/apachectl stop

3、卸载当前PHP和Zend Optimizer:
shell> rm -rf /usr/local/php
shell> rm -rf /usr/local/Zend
shell> vi /usr/local/apache2/conf/httpd.conf
找到LoadModule phpX_module modules/libphpX.so
其中X是PHP版本(4或者5)一行,并将此行删除,保存退出。

4、下载安装Discuz! GD库安装包:
shell> cd /usr/local/src
shell> wget -c http://download.discuz.net/gdinstaller.tar.gz
shell> tar xzvf gdinstaller.tar.gz
shell> cd GDInstaller
shell> ./install.sh

4、下载PHP 5.1.2:
shell> cd /usr/local/src
shell> wget -c http://download.discuz.net/php-5.1.2.tar.bz2

5、解压缩并安装PHP 5.1.2:
shell> tar xjvf php-5.1.2.tar.bz2
shell> cd php-5.1.2
shell> ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs \
--with-zlib-dir --with-bz2 --with-tiff-dir --with-libxml-dir --with-gd --with-freetype-dir \
--with-jpeg-dir --with-png-dir --with-ttf --enable-mbstring --with-mysql \
--with-config-file-path=/etc --disable-ipv6 --enable-gd-native-ttf
*注意:如果MySQL不是以RPM包方式安装的,则需要将上述参数中的--with-mysql
改为--with-mysql=/usr/local/mysql
shell> make
shell> make install
shell> cp php.ini-dist /etc/php.ini

6、下载Zend Optimizer 2.6.2:
shell> cd /usr/local/src
sehll> wget -c http://download.discuz.net/ZendOptimizer-2.6.2-linux-glibc21-i386.tar.gz

7、解压并安装Zend Optimizer 2.6.2:
shell> tar xzvf ZendOptimizer-2.6.2-linux-glibc21-i386.tar.gz
shell> cd ZendOptimizer-2.6.2-linux-glibc21-i386
shell> ./install.sh
*注意:安装Zend过程中提示输入php.ini位置时,请填写/etc


安装并重新启动Apache服务后,可以创建phpinfo.php文件检查GD库的支持情况。
更多内容请看PCdog.com--Linux安装  PHP  安装和硬件设置专题

  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体
关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved