centos 编译lnmp

安装依赖

# 安装编译工具:
yum install gcc automake autoconf libtool gcc-c++

# 安装基础库
yum install gd zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel

下载pcre 正则库
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.bz2
tar jxf pcre-8.39.tar.bz2
编译nginx

#编译nginx
cd /usr/local/src

wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar zxf nginx-1.8.0.tar.gz

cd nginx-1.8.0
./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/src/pcre-8.39
make && make install


编译php

cd /usr/local/src
wget http://cn2.php.net/get/php-7.1.15.tar.bz2/from/this/mirror
mv mirror php-7.1.15.tar.bz2
tar jxf php-7.1.15.tar.bz2

cd php-7.1.15
./configure --prefix=/usr/local/php --with-gd --with-freetype-dir --enable-gd-native-ttf --enable-mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-mcrypt --enable-mbstring --enable-zip --enable-fpm  
make && make install

# 复制配置文件
cp /usr/local/src/php-7.1.15/php.ini-development /usr/local/php/lib/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# 整合nginx+php
location ~ \.php$ {
    root           html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
    include        fastcgi_params;
}
# 启动php 和nginx
/usr/local/php/sbin/php-fpm
/usr/local/nginx/sbin/nginx

编译mysql

# 安装mysql
yum install mysql mysql-server








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值