標籤:
1、安裝Nginx:
安裝包目錄
mkdir -p /Data/tgz
cd /Data/tgz
安裝編譯依賴
yum install wgetyum install pcreyum install openssl*yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers makeyum -y install gd gd2 gd-devel gd2-devel
/usr/sbin/groupadd www/usr/sbin/useradd -g www www
ulimit -SHn 65535
perl語言相容Regex,是一個用C語言編寫的Regex函數
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gztar zxvf pcre-8.32.tar.gzcd pcre-8.32./configure --prefix=/Data/apps/pcremake && make installcd ../
wget http://nginx.org/download/nginx-1.5.2.tar.gztar zxvf nginx-1.5.2.tar.gzcd nginx-1.5.2./configure --user=www --group=www --prefix=/Data/apps/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/Data/tgz/pcre-8.32 --with-http_realip_module --with-http_image_filter_modulemakemake installcd ../
2、安裝 MySQL:
wget http://downloads.mysql.com/archives/mysql-5.6/mysql-5.6.10-linux-glibc2.5-x86_64.tar.gztar zxvf mysql-5.6.10-linux-glibc2.5-x86_64.tar.gzmv mysql-5.6.10-linux-glibc2.5-x86_64 /Data/apps/mysql/usr/sbin/groupadd mysql/usr/sbin/useradd -g mysql mysqlmkdir -p /Data/data/mysql/datayum install libaio/Data/apps/mysql/scripts/mysql_install_db --basedir=/Data/apps/mysql --datadir=/Data/data/mysql/data --user=mysqlsed -i "s#/usr/local/mysql#/Data/apps/mysql#g" /Data/apps/mysql/bin/mysqld_safe
3、安裝php依賴庫
php處理圖形的擴充庫,安裝GD庫前得先安裝freetype、libpng、jpegsrc、zlib等關聯庫
mkdir -p /Data/apps/libs/wget http://www.ijg.org/files/jpegsrc.v9.tar.gz tar zxvf jpegsrc.v9.tar.gzcd jpeg-9/./configure --prefix=/Data/apps/libs --enable-shared --enable-static --prefix=/Data/apps/libsmakemake installcd ../
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.2.tar.gztar zxvf libpng-1.6.2.tar.gzcd libpng-1.6.2/./configure --prefix=/Data/apps/libsmakemake installcd ../
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gztar zxvf freetype-2.4.12.tar.gzcd freetype-2.4.12/./configure --prefix=/Data/apps/libsmakemake install
********************************** 報錯 start *********************************當 make install 時總是:rm -f /usr/local/modules/freetype/include/freetype2/freetype/cache/*rmdir /usr/local/modules/freetype/include/freetype2/freetype/cacherm -f /usr/local/modules/freetype/include/freetype2/freetype/internal/*rmdir /usr/local/modules/freetype/include/freetype2/freetype/internalrmdir: ‘/usr/local/modules/freetype/include/freetype2/freetype/internal’: 沒有那個檔案或目錄make: [install] 錯誤 1 (忽略)/usr/bin/install -c -m 644 ./builds/unix/ft2unix.h /usr/local/modules/freetype/include/ft2build.h/usr/bin/install -c -m 644 ./builds/unix/ftconfig.h /usr/local/modules/freetype/include/freetype2/freetype/config/ftconfig.h/usr/bin/install -c -m 644 /opt/src/lamp/freetype-2.2.1/objs/ftmodule.h /usr/local/modules/freetype/include/freetype2/freetype/config/ftmodule.h/usr/bin/install -c -m 755 ./builds/unix/freetype-config /usr/local/modules/freetype/bin/freetype-config/usr/bin/install -c -m 644 ./builds/unix/freetype2.m4 /usr/local/modules/freetype/share/aclocal/freetype2.m4/usr/bin/install -c -m 644 ./builds/unix/freetype2.pc /usr/local/modules/freetype/lib/pkgconfig/freetype2.pc(報錯)解決辦法:mkdir /Data/apps/libs/include/freetype2/freetype/internal需要在freetype的安裝目錄下建立internal 這個目錄然後,make install********************************** 報錯 end *********************************
cd ../
php加密擴充庫
wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?big_mirror=0"tar zxvf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8/./configure --prefix=/Data/apps/libsmakemake installcd libltdl/./configure --prefix=/Data/apps/libs --enable-ltdl-installmakemake installcd ../../
mhash的可以用於建立校正數值,訊息摘要,訊息認證碼,以及無需原文的關鍵資訊儲存(如密碼)等。
wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?big_mirror=0"tar zxvf mhash-0.9.9.9.tar.gzcd mhash-0.9.9.9/./configure --prefix=/Data/apps/libsmakemake installcd ../vi /etc/ld.so.conf添加:/Data/apps/libs/lib然後:ldconfig
Mcrypt擴充庫可以實現加密解密功能,就是既能將明文加密,也可以密文還原。
wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz?big_mirror=0"tar zxvf mcrypt-2.6.8.tar.gzcd mcrypt-2.6.8/export LDFLAGS="-L/Data/apps/libs/lib -L/usr/lib"export CFLAGS="-I/Data/apps/libs/include -I/usr/include"touch malloc.h./configure --prefix=/Data/apps/libs --with-libmcrypt-prefix=/Data/apps/libsmakemake installcd ../
4、編譯安裝PHP 5.5
wget http://www.php.net/get/php-5.5.1.tar.gz/from/tw2.php.net/mirrortar zxvf php-5.5.1.tar.gzcd php-5.5.1/export LIBS="-lm -ltermcap -lresolv"export DYLD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"export LD_LIBRARY_PATH="/Data/apps/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"./configure --prefix=/Data/apps/php --with-config-file-path=/Data/apps/php/etc --with-mysql=/Data/apps/mysql --with-mysqli=/Data/apps/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir=/Data/apps/libs --with-jpeg-dir=/Data/apps/libs --with-png-dir=/Data/apps/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/Data/apps/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-ztsmakemake installcp php.ini-development /Data/apps/php/etc/php.inicd ../
ln -s /Data/apps/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylibmv /Data/apps/php/etc/php-fpm.conf.default /Data/apps/php/etc/php-fpm.conf
5、編譯安裝PHP擴充
wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gztar zxvf autoconf-latest.tar.gzcd autoconf-2.69/./configure --prefix=/Data/apps/libsmakemake installcd ../
wget http://pecl.php.net/get/memcache-2.2.7.tgztar zxvf memcache-2.2.7.tgzcd memcache-2.2.7/export PHP_AUTOCONF="/Data/apps/libs/bin/autoconf"export PHP_AUTOHEADER="/Data/apps/libs/bin/autoheader"/Data/apps/php/bin/phpize./configure --with-php-config=/Data/apps/php/bin/php-configmakemake installcd ../
開啟 /Data/apps/php/etc/php.ini 尋找 ; extension_dir = "ext"
在其後增加一行:
extension = "memcache.so"
原連結:http://zyan.cc/nginx_php_v7/
在 CentOS7最小化 下的編譯安裝:Nginx 1.5.2 + PHP 5.5.7 + MySQL 5.6.10