Nginx 1.5.2 + PHP 5.5.1 + MySQL 5.6.10 在 CentOS 下的編譯安裝

來源:互聯網
上載者:User

標籤:

 最近配置了幾台Web伺服器,將安裝筆記貼出來吧。沒時間像以前那樣,將文章寫的那樣系統了,請見諒。詳細配置,可以看以前的舊文章:  http://blog.zyan.cc/nginx_php_v6  1、安裝Nginx:mkdir -p /Data/tgzcd /Data/tgzyum 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 wwwulimit -SHn 65535wget 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依賴庫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 installcd ../wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz?big_mirror=0"wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?big_mirror=0"wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.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 ../../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然後:ldconfigtar 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.5wget 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"

 

Nginx 1.5.2 + PHP 5.5.1 + MySQL 5.6.10 在 CentOS 下的編譯安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.