三.安装GD库(tar包 让PHP支持GIF、PNG、JPEG)注意:不安装只会影响mantis的数据统计部分功能。安装包的获取:
3.1安装GD库3.1.1.安装jpeg6(jpegsrc.v6b.tar.gz)ftp://ftp.uu.net/graphics/jpeg/
mkdir -p /opt/jpeg6
mkdir -p /opt/jpeg6/bin
mkdir -p /opt/jpeg6/lib
mkdir -p /opt/jpeg6/include
mkdir -p /opt/jpeg6/man
mkdir -p /opt/jpeg6/man1
mkdir -p /opt/jpeg6/man/man1
tar –zxvf jpegsrc.v6b.tar.gz
./configure --prefix=/opt/jpeg6/ --enable-shared --enable-static
Make &&make install
3.1.2.安装libpng(libpng-1.2.35.tar.bz2)http://www.libpng.org/pub/png/libpng.html
tar –jxvf libpng-1.2.35.tar.bz2
./configure --prefix=/opt/libpng/
Make &&make install
3.1.3.安装freetype(freetype-2.3.9.tar.bz2)http://freetype.fis.uniroma2.it/download.html注意:需升级make version到3.80以上:下载地址:http://ftp.gnu.org/pub/gnu/make/
tar –zxvf freetype-2.3.9.tar.bz2
./configure --prefix=/opt/freetype
Make &&make install
3.1.4.安装zlib(zlib-1.2.3.tar.gz)http://zlib.net/index.html
tar –zxvf zlib-1.2.3.tar.gz
./configure --prefix=/opt/zlib
Make &&make install
3.1.5.安装GD库(gd-2.0.35.tar.gz) http://www.libgd.org/Downloads注意:需要对m4升级到1.4.12.(redhat5.4会安装默认的m4,下载新的m4软件包安装后指定安装目录/opt/m4然后把m4的bin里的可执行文件拷到/usr/bin/下覆盖以前即可)下载地址:http://ftp.gnu.org/pub/gnu/m4/注意:需要对autoconf升级到2.58或者更高(下载后安装即可)下载地址:http://ftp.gnu.org/pub/gnu/autoconf/
tar –zxvf gd-2.0.35.tar.gz
./configure --prefix=/opt/gd2 --with-jpeg=/opt/jpeg6/ --with-png=/opt/libpng/lib --with-zlib=/opt/zlib/lib --with-freetype=/opt/freetype/
Make &&make install
3.1.6安装Curl库(curl-7.19.4.tar.gz)http://curl.haxx.se/download.html
tar –zxvf curl-7.19.4.tar.gz
./configure --prefix=/opt/curl
Make &&make install四.安装PHP(tar包,PHP必须有libxml2支持)安装包的获取:http://www.php.net
4.1.安装libxml2网上搜包指定目录安装即可4.2.安装libxslt(可选安装)我当时没安装4.3.安装php5
tar –zxvf php-5.2.9.tar.gz
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/opt/libxml2/ --with-gd=/opt/gd2/ --with-jpeg-dir=/opt/jpeg6/ --with-png=/opt/libpng/lib --with-zlib-dir=/opt/zlib/lib/ --with-freetype-dir=/opt/freetype --with-curl=/opt/curl/ --with-mysql=/usr/local/mysql
make && make install
4.4配置文件cp php.ini-dist /opt/php/lib/php/php.ini五.重新配置Apache
5.1. vi /opt/apache/conf/httpd.conf
5.1.1找到AddType application/x-gzip .gz .tgz在其下面添加一行AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
5.1.1找到DirectoryIndex index.html修改为:DirectoryIndex index.html default.php index.php
5.2设置php文件后缀cp php.ini-dist /opt/php/lib/php/php.ini
Vi /opt/php/lib/php/php.ini找到register-globals这一行修改成:register-globals=on
5.3第一个php程序vi /opt/apache/htdocs/test.php文件内容为:<?php
Phpinfo();
?>
5.4重启apache服务service httpd restart
5.5检验是否成功在IE中输入如下网址