1.安装JPEG6 jpegsrc.v6b.tar.gz
# mkdir -p /usr/local/services/jpeg6
# mkdir -p /usr/local/services/jpeg6/bin
# mkdir -p /usr/local/services/jpeg6/lib
# mkdir -p /usr/local/services/jpeg6/include
# mkdir -p /usr/local/services/jpeg6/man
# mkdir -p /usr/local/services/jpeg6/man1
# mkdir -p /usr/local/services/jpeg6/man/man1
# tar -zvxf jpegsrc.v6b.tar.gz
# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/services/jpeg6/ --enable-shared --enable-static
# make
# make install
问题:jpeg6 make: ./libtool:命令未找到
解决:拷贝libtool文件到jpeg6安装文件目录
问题:x86_64-unknown-linux-gnu
解决:拷贝libtool文件到jpeg6文件目录(注意是安装包目录)
2.安装LIBpng libpng-1.2.8.tar.gz
# tar -zvxf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.std makefile
# vi makefile
在CFLAGS加入-fPIC
# make
# make install
3.安装Freetype freetype-2.4.4.tar.gz
# tar -zvxf freetype-2.4.4.tar.gz
# cd freetype-2.4.4
# ./configure --prefix=/usr/local/services/freetype
# make
# make install
问题:make: Nothing to be done for `unix'.忽略
4.安装Zlib zlib-1.2.5.tar.gz
# tar -zxvf zlib-1.2.5.tar.gz
# ./configure --prefix=/usr/local/services/zlib/
# make
# make install
问题:zlib/lib/libz.a: could not read symbols: Bad value
解决:在CFLAGS加入 -fPIC
5.安装GD GD-2.0.33.tar.gz
# tar -zxvf GD-2.0.33.tar.gz
# ./configure --prefix=/usr/local/services/gd2/ --with-jpeg=/usr/local/services/jpeg6/ --with-png=/usr/local/services/lib/ --with-zlib=/usr/local/services/zlib --with-freetype=/usr/local/services/freetype
显示:
Configuration summary for gd 2.0.33:
Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: no
Support for Xpm library: no
Support for pthreads: yes
# make
# make install
错误:/lib/libjpeg.a(jcapimin.o): could not read symbols: Bad value
解决:安装jpeg6的时候,加上CFLAGS="-O3 -fPIC"参数
6.安装Curl curl-7.19.4.tar.gz
# tar -zxvf curl-7.19.4.tar.gz
# ./configure --prefix=/usr/local/services/curl
# make
# make install
7.安装Libxml libxml2-2.7.7.tar.gz
# tar -zxvf libxml2-2.7.7.tar.gz
# ./configure --prefix=/usr/local/services/libxml2 --with-zlib=/usr/local/services/zlib/
# make
# make install
问题:“bin/rm: cannot remove `libtoolT': No such file or directory”
解决:
# aclocal
# autoconf
# automake
# libtoolize --force
问题:./.libs/libxml2.so: undefined reference to `gzopen64'
解决:vi编辑Makefile文件,然后在CFLAGS后面添加 -fPIC 参数
8.安装PHP php-5.3.10.tar.gz
# tar -zxvf php-5.3.10.tar.gz
# ./configure --prefix=/usr/local/services/php/ --with-apxs2=/usr/local/services/apache2/bin/apxs --with-libxml-dir=/usr/local/services/libxml2/ --with-gd=/usr/local/services/gd2/ --with-jpeg-dir=/usr/local/services/jpeg6/ --with-zlib-dir=/usr/local/services/zlib/ --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/services/freetype/ --with-curl=/usr/local/services/curl --enable-ftp
A.拷贝配置文件
# cp php.ini-production /usr/local/services/php/lib/php.ini
B.修改Apache2配置httpd.conf
在AddType application/x-gzip .gz .tgz 插入如下内容
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
C.创建测试文件,扩展名PHP
phpinfo();
?>
D.重启Apache
#/usr/local/services/apache2/bin/apachectl restart