php+openresty 部署安装

Posted 码农也疯狂

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php+openresty 部署安装相关的知识,希望对你有一定的参考价值。

1. ecs 购买

地域华北 2

可用区: 随机分配

安全组 ID: sg-2533jog6k

I/O 优化实例: I/O 优化实例

实例规格: 1 核 1GB

网络类型: 经典网络

带宽: 1Mbps(按固定带宽)

镜像: CentOS 7.2 64位

系统盘: 40GB 高效云盘

密码: 已设置

实例名称: test_server

2. php安装

    下载地址: http://php.net/get/php-7.1.4.tar.gz/from/a/mirror   

    安装依赖库:

    yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel pcre-dev

    安装PHP:

         ./configure --prefix=/usr/local/servers/php

         make  make install

   设置环境变量:

        vi /etc/profile 在文件末尾添加

        export PATH=$PATH:/usr/local/servers/php/bin

        执行 source  /etc/profile

3. openresty安装

    下载: wget https://openresty.org/download/openresty-1.11.2.2.tar.gz 

    安装依赖:

  yum install readline-devel pcre-devel openssl-devel gcc

    安装:

    ./configure --prefix=/usr/local/servers/openresty --with-luajit

  make && make install

    ln -s /usr/local/servers/openresty/nginx/sbin/nginx /usr/sbin/nginx     // 建立软连接

    /usr/sbin/nginx -c /usr/local/servers/openresty/nginx/conf/nginx.conf  // 启动nginx

    /usr/sbin/nginx -t    // 测试

 /usr/sbin/nginx -s reload   // 重启

 

 

 



以上是关于php+openresty 部署安装的主要内容,如果未能解决你的问题,请参考以下文章

dockerfile自动部署openresty+php7

openresty 安装部署脚本

OpenResty Redis 安装部署测试SET GET功能

干货Nginx与Openresty

部署openresty

安装OpenResty