Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux教程 >> RHEL5.4 安裝nginx-1.0 + php-5.2.17(fastcgi)+mysql-5.1.40

RHEL5.4 安裝nginx-1.0 + php-5.2.17(fastcgi)+mysql-5.1.40

日期:2017/2/7 14:35:44      編輯:Linux教程
 

一、下載需要的軟件包
#創建存放軟件包的目錄
mkdir -p /soft/diy
#下載nginx-1.0
wget http://www.nginx.org/download/nginx-1.0.0.tar.gz

下載php5.2.17
wget http://cn.php.net/get/php-5.2.17.tar.bz2/from/this/mirror

#下載fastcgi補丁
wget http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz

#下載mysql,由於mysql官網現在需要登錄才能下載,所以我使用自己的源碼倉庫、順便鄙視一下oracle公司
wget http://122.225.32.131/icons/mysql-5.1.40.tar.gz

#下載字符轉換庫libiconv
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz (下載太慢,最後我還是使用以前的1.13版本)
#下載PHP的memcache擴展
http://pecl.php.net/get/memcache-2.2.6.tgz
#下載PHP的imagick擴展
wget http://pecl.php.net/get/imagick-3.0.1.tgz
ftp://mirror.aarnet.edu.au/pub/imagemagick/ImageMagick-6.6.5-10.tar.bz2 imagick擴展的依耐包
#下載PHP的PDO擴展
wget http://pecl.php.net/get/PDO-1.0.3.tgz
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

#PHP加速器相關下載,一般選擇一種,這裡我們講4種常見的加速軟件
#下載eaccelerator加速
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
#下載ZendOptimizer,由於官網下載需要注冊,所以我們在opser上下載
wget http://soft.vpser.net/web/zend/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
#下載PHP的apc擴展
wget http://pecl.php.net/get/APC-3.1.7.tgz
#xcache加速
wget http://xcache.lighttpd.net/pub/Releases/1.3.2-rc1/xcache-1.3.2-rc1.tar.bz2

上面是一些軟件的下載地址,如果沒有的情自己google找,官網都可以下載,不過速度比較慢
MD5值 軟件名
94239866e5d1b90e02675e988a5cbad4 APC-3.1.7.tgz
e2167713316639705202cf9b6cb1fdb1 imagick-3.0.1.tgz
048032a3032ebd182150bdee30a5d533 libiconv-1.13.tar.gz
0821830d930a86a5c69110837c55b7da libmcrypt-2.5.8.tar.gz
97639f8821b10f80943fa17da302607e mcrypt-2.6.8.tar.gz
9542f1886b72ffbcb039a5c21796fe8a memcache-2.2.6.tgz
ee66b7d5947deb760aeff3f028e27d25 mhash-0.9.9.9.tar.gz
32e7373c16271606007374396e6742ad mysql-5.1.40.tar.gz
5751c920c266ea5bb5fc38af77e9c71c nginx-1.0.0.tar.gz
2256d0a1d0a358265165ca70e7cfc47a pcre-7.9.tar.gz
74bff68b3f1caaf745edaddbd4df7291 PDO-1.0.3.tgz
6121f450488dd4893f5702051c1f84fb PDO_MYSQL-1.0.2.tgz
5339a2a9c6a0b015b7ce5fcb8d90de84 php-5.2.17-fpm-0.5.14.diff.gz
150586c3af37fbdfa504cf142c447e57 ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
32ccd838e06ef5613c2610c1c65ed228 eaccelerator-0.9.6.1.tar.bz2
305bc145200ef5c1f7bba08a12c5f4f2 ImageMagick-6.6.5-10.tar.bz2
b27947f3045220faf16e4d9158cbfe13 php-5.2.17.tar.bz2
5f6ac6f6f4f8ec2322f0bb040559663b xcache-1.3.2-rc1.tar.bz2
3d0a037e73ffe40ea55b521cbff7ff8d go-pear.phar

二、安裝前的准備工作
1、檢查是否已經安裝apache,php和mysql的rpm包
rpm -qa | egrep ‘httpd|mysql|php’
如果有
yum remove 對應的軟件
2、安裝必須的軟件
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file
yum -y install libtool libtool-libs autoconf kernel-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel gd gd-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal nano sendmail
yum -y install fonts-chinese gettext gettext-devel
yum -y install ncurses-devel
yum -y install gmp-devel pspell-devel
yum -y install unzip

三、開始安裝
1、安裝PHP需要的庫
libiconv-1.13.tar.gz加強系統對支持字符編碼轉換的功能
tar -zxvf libiconv-1.13.tar.gz
cd libiconv-1.13
./configure --prefix=/usr/local/
make && make install
cd ..
libmcrypt-2.5.8.tar.gz加密算法庫,php擴展mcrypt功能對此庫有依耐關系,要使用mcrypt必須先安裝此庫
tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure && make && make install
ldconfig
cd libltdl/
./configure --enable-ltdl-install
make && make install
cd ../..
mhash-0.9.9.9.tar.gz hash加密算法庫
tar -zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure && make && make install
cd ..
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2

Copyright © Windows教程網 All Rights Reserved