首先准备安装包httpd-2.2.11.tar.gz, mysql-5.0.67.tar.gz,php-5.2.8.tar.gz。这些包可以到官方网站上自行下载,都是免费的,本来想上传这些包的,但太大了,60多兆。把它们放到php-5.2.8.tar.gz目录/usr/local/src是放置源码的目录,一般情况下人们都习惯把源码文件放到这里,再把以下脚本拷贝到/usr/local/src下,安装脚本已经经过我的测试,如有问题请和我联系,脚本内容如下
#!/bin/bash
install=`pwd`
mkdir /usr/local/modules
mkdir /usr/local/modules/jpeg6
mkdir /usr/local/modules/jpeg6/bin
mkdir /usr/local/modules/jpeg6/lib
mkdir /usr/local/modules/jpeg6/include
mkdir /usr/local/modules/jpeg6/man
mkdir /usr/local/modules/jpeg6/man/man1
mkdir /usr/local/mysql
mkdir /usr/local/mysql/data
echo start mysql------------------------------------------------------------------
groupadd mysql
useradd -g mysql mysql
cd $install
tar -zxvf mysql-5.0.67.tar.gz
cd mysql-5.0.67
#./configure --prefix=/usr/local/mysql --sysconfdir=/etc --enable-assembler --with-charset=gbk --with-extra-charsets=all
--localstatedir=/usr/local/mysql/data
cd /usr/local/mysql/bin
nohup ./mysql_install_db --user=mysql&
cd ../
chown -R root .
chown -R mysql data
chgrp -R mysql .
echo start libxml------------------------------------------------------------------
sleep 5
cd $install
tar -xzvf libxml2-2.7.3.tar.gz
cd libxml2-2.7.3
./configure
make
make install
echo start libiconv------------------------------------------------------------------
sleep 5
cd $install
tar xzvf libiconv-1.12.tar.gz
cd libiconv-1.12
./configure --prefix=/usr/local/modules/libiconv
make
make install
echo start zlib------------------------------------------------------------------
sleep 5
cd $install
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local/modules/zlib2
make
make install
echo start freetype------------------------------------------------------------------
sleep 5
cd $install
tar xzvf freetype-2.3.8.tar.gz
cd freetype-2.3.8
./configure --prefix=/usr/local/modules/freetype
make
make install
echo start libpng------------------------------------------------------------------
sleep 5
cd $install
tar libpng-1.2.34.tar.gz
cd libpng-1.2.34
./configure --prefix=/usr/local/modules/libpng2
make
make install
echo start jpeg------------------------------------------------------------------
sleep 5
cd $install
tar xzvf jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure --prefix=/usr/local/modules/jpeg6 --enable-shared --enable-static
make
make install
echo start gdgd------------------------------------------------------------------
sleep 5
cd $install
tar xzvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/modules/gd --with-jpeg=/usr/local/modules/jpeg6 --with-png=/usr/local/modules/libpng2 --with-zlib=/usr/local/modules/zlib2 --with-freetype=/usr/local/modules/freetype
make
make install
echo start httpd------------------------------------------------------------------
sleep 5
cd $install
tar xzvf httpd-2.2.11.tar.gz
cd httpd-2.2.11
./configure --prefix=/usr/local/apache --with-mysql=/var/lib/mysql --enable-track-vars --enable-cgi --enable-module=so --enable-mods-shared=all --with-mpm=worker
make
make install
echo start phphp------------------------------------------------------------------
sleep 5
cd $install
tar xzvf php-5.2.8.tar.gz
cd php-5.2.8
/configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs \
--with-jpeg-dir=/usr/local/modules/jpeg6/ --with-png=/usr/local/modules/libpng2/ --with-gd=/usr/local/modules/gd/ \
--with-zlib=/usr/local/modules/zlib2/ --with-freetype-dir=/usr/local/modules/freetype\
--enable-magic-quotes --with-mysql=/usr/local/mysql --enable-track-vars --enable-force-cgi-redirect \
--with-iconv=/usr/local/modules/libiconv/ \
--enable-sockets --enable-gd-native-tt --with-gd-imgstrttf --enable-trace-vars\
make
make install
cp -f php.ini-dist /usr/local/php/lib/php.ini
echo install sucess!
阅读(971) | 评论(0) | 转发(0) |