共计 2505 个字符,预计需要花费 7 分钟才能阅读完成。
CentOS 6.3 编译安装 LNMP 环境,安装必要的依赖关系:
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel bzip2 bzip2-devel curl curl-devel openssl openssl-devel gd gd-devel libmcrypt libmcrypt-devel pcre pcre-devel libaio
安装必要的工具:
yum -y install gcc gcc-c++ make
编译安装 mcrypt:
1. 首先安装 Libmcrypt:
下载地址:http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/
tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
2. 安装 mhash
下载地址:http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/
tar -zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make
make install
3. 安装 mcrypt
下载地址:http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/
tar -zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
export LD_LIBRARY_PATH=/usr/local/lib
./configure
make
make install
编译安装 Nginx
./configure –prefix=/usr/local/nginx –user=www –group=www –with-http_stub_status_module
make && make install
编译安装 MySQL
下载 MYSQL 源码,按照 INSTALL-BINARY 文档里面的说明部署即可~
编译安装 PHP
PHP 编译参数:
./configure –prefix=/usr/local/php \
–with-libxml-dir \
–with-zlib \
–with-curl \
–enable-exif \
–with-gd \
–with-jpeg-dir \
–with-png-dir \
–with-freetype-dir \
–with-gettext \
–with-openssl \
–with-mcrypt \
–with-mysql=/usr/local/mysql \
–with-mysqli=/usr/local/mysql/bin/mysql_config \
–with-pdo-mysql=/usr/local/mysql \
–enable-soap \
–with-iconv \
–with-pear \
–enable-sockets \
–enable-fpm \
–enable-pcntl \
–enable-mbstring \
–enable-fileinfo \
make && make install
将 /usr/local/php/etc/ 下的 php-fpm.conf.default 改为 php-fpm.conf
PS:
1. 一个小技巧,安装完成之后把 php 目录改成 php+ 版本号,然后再做一个链接到这个目录,方便以后多个版本的替换
lrwxrwxrwx. 1 root root 9 6 月 22 07:03 php -> php5.6.9/
drwxr-xr-x. 9 root root 4096 6 月 21 11:03 php5.6.9
drwxr-xr-x. 9 root root 4096 6 月 21 10:38 php7.0.0
2. 如果安装的是 php7,还要把 /usr/local/php/etc/php-fpm.d 目录的 www.conf.default 改成 www.conf
Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm
CentOS 6.4 下的 LNMP 生产环境搭建及安装脚本 http://www.linuxidc.com/Linux/2013-11/92428.htm
生产环境实用之 LNMP 架构的编译安装 +SSL 加密实现 http://www.linuxidc.com/Linux/2013-05/85099.htm
LNMP 全功能编译安装 for CentOS 6.3 笔记 http://www.linuxidc.com/Linux/2013-05/83788.htm
CentOS 6.3 安装 LNMP (PHP 5.4,MyySQL5.6) http://www.linuxidc.com/Linux/2013-04/82069.htm
在部署 LNMP 的时候遇到 Nginx 启动失败的 2 个问题 http://www.linuxidc.com/Linux/2013-03/81120.htm
Ubuntu 安装 Nginx php5-fpm MySQL(LNMP 环境搭建) http://www.linuxidc.com/Linux/2012-10/72458.htm
更多 CentOS 相关信息见 CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-10/123844.htm