一.安装nginx(这里我安装的是1.15)

1.安装必要的依赖

yum install pcre pcre-devel openssl openssl-devel -y

2.添加用户群组

useradd nginx -s /sbin/nologin -M

3.安装nginx

tar -zxvf nginx-1.15.6.tar.gzcd  nginx-1.15.6./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_modulemake && make install

二.安装php

1.安装必要的依赖

yum install bzip2-devel libmcrypt-devel libxml2-devel libjpeg-devel libpng-devel freetype-devel libicu-devel libxslt* curl curl-devel libxslt-devel* -y

2.安装libmcrypt

tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make
make install
sleep 2
/sbin/ldconfig 

3.安装php

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-config-file-scan-dir=/usr/local/php/conf.d --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local/curl --enable-mbregex --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 --with-gettext --enable-opcache=no --enable-intl --with-xslmake && make installcp php.ini-production /usr/local/php/etc/php.inicp /usr/local/php/etc/php-fpm.conf.default  usr/local/php/etc/php-fpm.conf

4.错误处理

编译的时候加 --enable-opcache=no

# 添加搜索路径到配置文件

echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf

# 更新配置

ldconfig -v

CentOS7.4安装nginx和php5.40相关推荐

  1. Centos7.4安装Nginx

    Centos7.4安装Nginx 使用yum命令 一.安装准备 首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.open ...

  2. 学习笔记(1)centos7 下安装nginx

    学习笔记(1)centos7 下安装nginx 这里我是通过来自nginx.org的nginx软件包进行安装的. 1.首先为centos设置添加nginx的yum存储库 1.通过vi命令创建一个rep ...

  3. centos 6.5 php nginx,CentOS6.5上安装nginx与php5.5

    CentOS6.5上安装nginx与php5.5 2014年04月08日 1. 安装必要的包 # rpm -Uvh http://download.fedoraproject.org/pub/epel ...

  4. CentOS7.3安装Nginx

    CentOS7.3安装Nginx 1.7.4   一.安装准备 首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.open ...

  5. 在centOS7中安装nginx教程

    在centOS7中安装nginx教程 在安装nginx之前,确保你的虚拟机能够联网! 安装nginx步骤: 一.安装好nginx所依赖的环境(gcc.PCRE.zlib.Open SSL). 二.安装 ...

  6. Centos7 编译安装 Nginx、MariaDB、PHP

    前言 本文主要大致介绍CentOS 7下编译安装Nginx.MariaDB.PHP.面向有Linux基础且爱好钻研的朋友.技艺不精,疏漏再所难免,还望指正. 环境简介: 系统: CentOS 7,最小 ...

  7. Centos7 编译安装Nginx

    文章目录 前言 一.编译安装nginx 二.编译安装过程 1.操作系统的选择,centos7 1.1关闭防火墙.selinux 2.安装编译开发环境 2.1安装nginx所需的一些第三方系统库的支持 ...

  8. centos7.0 安装nginx

    在centos7.0下安装nginx需要安装 prce和zlib包去官网下载相应的包 然后解压相应的包进行编译 解压nginx源码包进入到解压文件 ./configure--sbin-path=/us ...

  9. [腾讯云]简单在腾讯云 CenTOS7.0 安装Nginx,Mysql(MariaDB),Memcache,解析PHP!

    1.安装LNMP之前要安装EPEL,以便安装源以外的软件,如Nginx,phpMyAdmin等. yum install epel-release 2.安装Nginx a) yum install n ...

最新文章

  1. JavaScript中的call、apply、bind深入理解
  2. 关于实现udev/mdev自动挂载与卸载
  3. web前端——让人头疼的多列复选框排列解决办法
  4. java中什么方法用来清空流_这个真的写的很细,JavaIO中的常用处理流,看完只有10%的人还不懂了...
  5. 用python写网络爬虫 第2版 pd_用Python写网络爬虫(第2版)
  6. JAVA day27,28 线程池
  7. 单表mysql分页查询语句怎么写_MySQL单表百万数据记录分页性能优化技巧
  8. 何为线性时不变系统!详解
  9. 在AndroidMenifest动态引用ApplicationId,解决INSTALL_FAILURE_CONFLICTION_PROVIDER
  10. 浅聊矢量场 —— 3. 什么是旋度(Rotational Vector)
  11. Xshell重启服务器
  12. yum下载速度慢解决,提速飞起来
  13. 微信小程序监听服务器发送消息,微信小程序实时聊天WebSocket
  14. GME轧空事件的战后处置和思考
  15. Revit二次开发从入门到精通学习之路, (含Revit二次开发教程下载)
  16. 【MySQL】MySQL用 limit 为什么会影响性能?
  17. 生命周期组件框架:带有多状态机的单实现类
  18. CoreDNS介绍以及解析流程【kubernetes】
  19. DSP、SSP、RTB、ADX(概念通俗解释)
  20. Angel_天使PE优盘启动工具网络纯净版v2023.01.12

热门文章

  1. vxlan 分布式网关数据包转发过程_Vxlan基础
  2. Visual Studio 2017配置CTP的API文件
  3. golang.org/x/net包的安装方法
  4. python 爬取教务处通知
  5. 老板让我从上千个Excel中筛选数据,利用Python分分钟解决!
  6. Python编写俄罗斯方块小游戏
  7. ORC 在 Hive 中的应用
  8. 使用idea本地运行mapreduce程序,控制台log4j日志没有打印出来,可以这样解决
  9. 用公式求e^x的近似值
  10. 使用Anaconda进行环境和包的管理