CentOS compilation and installation Nginx1.5.2 + PHP5.5.1 + MySQL5.6.10

Source: Internet
Author: User
Tags install openssl openldap
I have recently configured several Web servers and posted installation notes. 1. install Nginx: mkdir-p/Data/tgzcd/Data/tgzyuminstallwgetyuminstallpcreyuminstallopenssl * yum-yinstallgccgcc-c ++ autoconflib#libjpeg-devellibpnglibpng-develfr

I have recently configured several Web servers and posted installation notes.

1. install Nginx:

Mkdir-p/Data/tgz
Cd/Data/tgz
Yum install wget
Yum install pcre
Yum install openssl *
Yum-y install gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses- devel curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel openldap-devel nss_ldap openldap-clients openldap-servers make
Yum-y install gd gd2 gd-devel gd2-devel
/Usr/sbin/groupadd www
/Usr/sbin/useradd-g www
Ulimit-SHn 65535
Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.32.tar.gz
Tar zxvf pcre-8.32.tar.gz
Cd pcre-8.32
./Configure -- prefix =/Data/apps/pcre
Make & make install
Cd ../

Wget http://nginx.org/download/nginx-1.5.2.tar.gz
Tar zxvf nginx-1.5.2.tar.gz
Cd 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_module
Make
Make install
Cd ../



2. install MySQL:

Wget http://downloads.mysql.com/archives/mysql-5.6/mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
Tar zxvf mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
Music mysql-5.6.10-linux-glibc2.5-x86_64/Data/apps/mysql
/Usr/sbin/groupadd mysql
/Usr/sbin/useradd-g mysql
Mkdir-p/Data/data/mysql/data
Yum install libaio
/Data/apps/mysql/scripts/mysql_install_db -- basedir =/Data/apps/mysql -- datadir =/Data/data/mysql/data -- user = mysql

Sed-I "s #/usr/local/mysql #/Data/apps/mysql # g"/Data/apps/mysql/bin/mysqld_safe



3. install the PHP dependency Library

Mkdir-p/Data/apps/libs/
Wget http://www.ijg.org/files/jpegsrc.v9.tar.gz
Tar zxvf jpegsrc.v9.tar.gz
Cd jpeg-9/
./Configure -- prefix =/Data/apps/libs -- enable-shared -- enable-static -- prefix =/Data/apps/libs
Make
Make install
Cd ../

Wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.2.tar.gz
Tar zxvf libpng-1.6.2.tar.gz
Cd libpng-1.6.2/
./Configure -- prefix =/Data/apps/libs
Make
Make install
Cd ../

Wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
Tar zxvf freetype-2.4.12.tar.gz
Cd freetype-2.4.12/
./Configure -- prefix =/Data/apps/libs
Make
Make install
Cd ../


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.gz
Cd libmcrypt-2.5.8/
./Configure -- prefix =/Data/apps/libs
Make
Make install
Cd libltdl/
./Configure -- prefix =/Data/apps/libs -- enable-ltdl-install
Make
Make install
Cd ../../


Tar zxvf mhash-0.9.9.9.tar.gz
Cd mhash-0.9.9.9/
./Configure -- prefix =/Data/apps/libs
Make
Make install
Cd ../



Vi/etc/ld. so. conf


Add:

/Data/apps/libs/lib


Then:

Ldconfig



Tar zxvf mcrypt-2.6.8.tar.gz
Cd 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/libs
Make
Make install
Cd ../



4. Compile and install PHP 5.5

Wget http://www.php.net/get/php-5.5.1.tar.gz/from/tw2.php.net/mirror
Tar zxvf php-5.5.1.tar.gz
Cd php-5.5.1/
Export LIBS = "-lm-ltermcap-lresolv"
Export DYLD_LIBRARY_PATH = "/Data/apps/mysql/lib/:/usr/local/lib:/lib64 /: /usr/lib64/:/usr/local/lib64"
Export LD_LIBRARY_PATH = "/Data/apps/mysql/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
Make
Make install
Cp php. ini-development/Data/apps/php/etc/php. ini
Cd ../


Ln-s/Data/apps/mysql/lib/libmysqlclient.18.dylib/usr/lib/libmysqlclient.18.dylib
Mv/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.gz
Tar zxvf autoconf-latest.tar.gz
Cd autoconf-2.69/
./Configure -- prefix =/Data/apps/libs
Make
Make install
Cd ../

Wget http://pecl.php.net/get/memcache-2.2.7.tgz
Tar zxvf memcache-2.2.7.tgz
Cd 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-config
Make
Make install
Cd ../



Open/Data/apps/php/etc/php. ini to search; extension_dir = "ext"
Add a line after it:

Extension = "memcache. so"


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.