RedHat Enterprise Linux 5下配置Apache+Mysql+Php

2020-01-30 11:29:17于海丽

我这次的顺序就没有先安装zlib,就随便选择来安装了,先是Curl,
#tar zxvf curl-7.15.0.tar.gz
#cd curl-7.15.0
#./configure --prefix=/usr/local/curl
(我认为可以加上--with-zlib开关,只是这次我没有用)
#make
#make install
jpeg的安装,jpeg不能自己创建安装所需的目录,要提前创建好
#mkdir -pv /usr/local/jpeg/{,bin,lib,include,man/man1,man1}
#./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
#make
#make install
libxml2的安装
#tar zxvf libxml2-2.6.31.tar.gz
#cd libxml2
#./configure --prefix=/usr/local/libxml2
(可以尝试打开zlib开关,--with-zlib)
#make(时间可能稍微长些)
#make install
#cp xml2-config /usr/bin
LibPDF的安装
#tar zxvf PDFlib-7.0.3-Linux-php.tar.gz
#cd pdflib
#cp bind/php5/php520mt/libpdf-php.so /usr/local/lib/
(上面的php520mt目录的同级目录中有php503,php510,php520目录,不知道是不是版本的区别)
T1lib的安装
#tar zxvf t1lib-5.0.0.tar.gz
#cd t1lib
#./configure --prefix=/usr/local/t1lib
#make without-doc
#make install
Freetype的安装
#tar zxvf freetype-2.3.5.tar.gz
#cd freetype
#./configure --prefix=/usr/local/freetype
#make
#make install
Zlib的安装
#tar zxvf zlib-1.2.3.tar.gz
#./configure --shared
#make
#make install
Libpng的安装
#tar zxvf libpng-1.2.26.tar.gz
#cd libpng
#cp scripts/makefile.linux ./makefile
#./configure --prefix=/usr/local/libpng
#make
#make install
GDlib的安装,可能会出现 AM_ICON 的错误提示,此时需要安装 gettext 软件包
#tar zxvf gettext-0.16.tar.gz
#cd gettext
#./configure --prefix=/usr/local/gettext
#make
#make install(时间稍长)
接下来是gdlib的安装
#tar zxvf gd-2.0.35.tar.gz
#cd gd
#./configure --with-png=/usr/local/lib
--with-zlib=/usr/local/lib
--with-freetype=/usr/local/freetype/lib
--with-jpeg=/usr/local/jpeg/lib
#make
#make install
PHP5的安装
#tar zxvf php-5.2.5.tar.bz2
#cd php
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
--enable-track-vars --with-sockets --enable-sockets --with-sysvshm --with-sysvsem
--with-pdflib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/jpeg
--with-png-dir=/usr/local/lib --with-zlib-dir=/usr/local/lib
--with-freetype-dir=/usr/local/freetype --with-curl=/usr/local/curl
--with-libxml-dir=/usr/locallibxml2/lib --with-t1lib=/usr/localt1lib
--with-gettext=/usr/localgettext/lib --with-gd --with-mysql
(最好加上mbstring 和 mcypt ,不知道是不是必须)
configure后如果成功会提示PHP欢迎界面: Thank you for using PHP.
#make
#make test
(大约3000多项测试吧)
# make install