Applicable environment:
CentOS 6.5 32bit
Linux + Nginx + Mysql + PHP
Version and Time: (as of this post date 2014-10-14, all versions are the latest version)
Nginx-1.7.6
Mysql-5.6.21
PHP-5.6.1
First, Download:
Nginx:http://nginx.org/en/download.html
mysql:http://dev.mysql.com/downloads/mysql/(select Linux-generic version of linux-generic (glibc 2.5) (x86, 32-bit), Compressed )
php:http://php.net/downloads.php#v5.6.1
Second, installation (ignoring the decompression process, after installation of the default path in/usr/local/xxx):
<1> Nginx
1. Install Dependency Pack: # yum-y Install Pcre-devel Zlib-devel
2. Configure the installation:
#./configure
# Make && make install
3. Create a soft link: # ln-s/usr/local/nginx/sbin/nginx/usr/local/bin/
4. Enter the/usr/local/nginx/conf directory, establish the virtual host configuration directory, and import this directory into the nginx.conf
# mkdir Vhost
# Vim./nginx.conf (add a row before the last curly brace and save the exit: include vhost/*.conf; )
5. You can create a new virtual host profile within the Vhost directory, end With. conf, and refer to the server section in nginx.conf
<2>mysql
1. Move the extracted directory directly to the/usr/local/mysql
2. Enter the/usr/local/mysql directory and execute the following series of commands (from the MySQL official website: http://dev.mysql.com/doc/refman/5.6/en/binary-installation.html):
3. Configure MY.CNF
A. # VIM/ETC/MY.CNF
B. Modify several items (under [mysqld]):
Datadir=/usr/local/mysql/data
Socket=/tmp/mysql.sock
Character-set-server=utf8
Collation-server=utf8_general_ci
C. Save exit and restart MySQL
<3>php
1. Install Dependency Pack: # yum-y Install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel openldap-devel Libmcrypt-devel
2. Establish a soft link (fix PHP5.6 compile times don ' t know how to define struct flock on the This system, set--enable-opcache=no error):
# sudo ln-s/usr/local/mysql/lib/libmysqlclient.so/usr/lib/
# sudo ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib/libmysqlclient.so.18
3. Configuration:
#./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql-- With-mysqli=/usr/local/mysql/bin/mysql_config--with-iconv-dir=/usr/local--with-freetype-dir--with-jpeg-dir-- With-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-discard-path-- Enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl-- With-curlwrappers--enable-mbregex--enable-fastcgi--enable-fpm--enable-force-cgi-redirect--enable-mbstring-- With-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-ldap- -WITH-LDAP-SASL--with-xmlrpc--enable-zip--enable-soap--without-pear--with-zlib--enable-pdo--with-pdo-mysql
4. Compile the installation (start this step without error during the previous configuration process):
# Make && make install