LNMP环境安装centos5x/nginx_1.4/mysql_5.6/php_5.4

##mysql采用的免编译安装方式

cd /usr/local/src/

yum remove httpd php mysql

yum groupinstall "Development Tools" pcre pcre-devel -y

wget http://nginx.org/download/nginx-1.4.0.tar.gz

wget http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz

wget http://cn2.php.net/distributions/php-5.4.45.tar.gz

#wget 附件 mysql-conf nginx_service

#mv  mysql-conf /etc/my.cnf

#mv nginx_service /etc/inid.d/nginx

#chmod u+x 

tar -zxf nginx-1.4.0.tar.gz

tar -zxf mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz 

tar -zxf php-5.4.45.tar.gz

##NGINX安装

cd nginx-1.4.0

./configure  --prefix=/usr/local/nginx

make && make install

##Mysql安装所需的库文件

yum install zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* curl-devel

yum install cmake

cd mysql-5.6.26-linux-glibc2.5-x86_64

##免编译安装

mv mysql-5.6.26-linux-glibc2.5-x86_64 /usr/local/mysql

##下载附件my.cnf到/etc/my.cnf

mkdir /data

scripts/mysql_install_db  --user=mysql  --basedir=/usr/local/mysql --datadir=/data/mysql

cp support-files/mysql.server /etc/init.d/mysqld

chkconfig mysqld on

echo 'export PATH=/usr/local/mysql/bin:$PATH' >> /etc/profile

service mysqld start

mysql -uroot -p -S /data/mysql/mysql.sock

##安装PHP

cd /usr/local/src/php-5.4.45

yum install libjpeg-devel libpng-devel freetype-devel 

ln -s /usr/local/mysql/lib/libmysqlclient.so.18  /usr/lib64/

./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 --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-magic-quotes --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 --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --with-mime-magic

make && make install

vi /usr/local/nginx/html/info.php

<?php

    phpinfo();

?>

http://essun.blog.51cto.com/721033/1288442