Compile and install under CentOS7 minimization: Nginx 1.5.2 + PHP 5.5.7 + MySQL 5.6.10

Source: Internet
Author: User
Tags curl fpm install php install openssl mcrypt openssl openldap

1, install Nginx:

Install package Directory

Mkdir-p/data/tgz
Cd/data/tgz

Install compilation dependencies

Yum Install Wgetyum install Pcreyum install OpenSSL*-y install gcc gcc-c++ autoconf libjpeg libjpeg-deve L libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel BZ IP2 bzip2-devel ncurses ncurses-devel Curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openss L openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap--y install gd GD2 gd-devel gd2-devel

/usr/sbin/groupadd www/usr/sbin/useradd-g www www
Ulimit-shn 65535

Perl language-compatible regular expression, is a regular expression function written in C language

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/&& 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. Install 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.Ten-LINUX-GLIBC2.5-X86_64.TAR.GZMV MySQL-5.6.Ten-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. Install PHP Dependency Library

PHP processing Graphics Extension Library, install the GD library before installing FreeType, libpng, JPEGSRC, zlib and other related libraries

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.  A . TAR.GZCD FreeType-2.4. /. /configure--prefix=/data/apps/libsmakemake Install

Error start ********************************* When make install is always: 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 ': No file or directory make: [Install] Error 1 (ignore)/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/us R/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/free Type/share/aclocal/freetype2.m4/usr/bin/install-c-M 644/builds/unix/freetype2.pc/usr/local/modules/freetype /LIB/PKGCONFIG/FREETYPE2.PC (Error) Workaround: mkdir/data/apps/libs/include/freetype2/freetype/ Internal need to create internal this directory under FreeType installation directory and make install********************************** error end ****************** ***************

Cd.. /

PHP Encryption Extension Library

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 can be used to create checksum values, message summaries, message authentication codes, and key information that does not need to be saved (such as passwords).

" 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. //etc/ld.so.conf add:/data/apps/libs/Lib then: Ldconfig

MCrypt Extension Library can implement encryption and decryption function, that is, the plaintext can be encrypted, or ciphertext can be restored.

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. Compile and install 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. Compile and install PHP extensions

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. /

Open/data/apps/php/etc/php.ini Find; Extension_dir = "ext"

Add a line after:

Extension = "memcache.so"

Original link:http://zyan.cc/nginx_php_v7/





Compile and install under CentOS7 minimization: Nginx 1.5.2 + PHP 5.5.7 + MySQL 5.6.10

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.