openresty php 整合,从零搭建php环境-openresty

本文介绍了如何通过yum安装Perl模块解决编译错误,详细步骤包括配置编译参数、安装PCRE和OpenSSL库,以及编译和安装OpenResty 1.19.3.1的过程。重点在于遇到的问题及解决方案,最后指出OpenResty作为增强版Nginx的特性将在后续使用中显现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

参考来源:http://openresty.org/en/insta…

一、配置编译参数,使用默认

> cd /usr/local/src/

> tar -xvf openresty-1.19.3.1.tar.gz

> cd openresty-1.19.3.1

> ./configure -j2

1、Can’t locate File/Temp.pm in @INC (you may need to install the File::Temp module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./configure line 9.

yum install perl

2、./configure: error: the HTTP rewrite module requires the PCRE library.

You can either disable the module by using –without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

statically from the source with nginx by using –with-pcre= option.

ERROR: failed to run command: sh ./configure –prefix=/usr/local/openresty/nginx …

yum -y install pcre-devel

3、./configure: error: SSL modules require the OpenSSL library.

You can either do not enable the modules, or install the OpenSSL library

into the system, or build the OpenSSL library statically from the source

with nginx by using –with-openssl= option.

ERROR: failed to run command: sh ./configure –prefix=/usr/local/openresty/nginx …

yum -y install openssl openssl-devel

Configuration summary

+ using system PCRE library

+ using system OpenSSL library

+ using system zlib library

nginx path prefix: "/usr/local/openresty/nginx"

nginx binary file: "/usr/local/openresty/nginx/sbin/nginx"

nginx modules path: "/usr/local/openresty/nginx/modules"

nginx configuration prefix: "/usr/local/openresty/nginx/conf"

nginx configuration file: "/usr/local/openresty/nginx/conf/nginx.conf"

nginx pid file: "/usr/local/openresty/nginx/logs/nginx.pid"

nginx error log file: "/usr/local/openresty/nginx/logs/error.log"

nginx http access log file: "/usr/local/openresty/nginx/logs/access.log"

nginx http client request body temporary files: "client_body_temp"

nginx http proxy temporary files: "proxy_temp"

nginx http fastcgi temporary files: "fastcgi_temp"

nginx http uwsgi temporary files: "uwsgi_temp"

nginx http scgi temporary files: "scgi_temp"

cd ../..

Type the following commands to build and install:

gmake

gmake install

二、编译

gmake

-L/usr/local/src/openresty-1.19.3.1/build/luajit-root/usr/local/openresty/luajit/lib -L/usr/local/src/openresty-1.19.3.1/build/luajit-root/usr/local/openresty/luajit/lib -Wl,-rpath,/usr/local/openresty/luajit/lib -Wl,--require-defined=pcre_version -Wl,-E -Wl,-E -ldl -lpthread -lcrypt -L/usr/local/src/openresty-1.19.3.1/build/luajit-root/usr/local/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/usr/local/src/openresty-1.19.3.1/build/luajit-root/usr/local/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lpcre -lssl -lcrypto -ldl -lpthread -lz

-Wl,-E

sed -e "s|%%PREFIX%%|/usr/local/openresty/nginx|"

-e "s|%%PID_PATH%%|/usr/local/openresty/nginx/logs/nginx.pid|"

-e "s|%%CONF_PATH%%|/usr/local/openresty/nginx/conf/nginx.conf|"

-e "s|%%ERROR_LOG_PATH%%|/usr/local/openresty/nginx/logs/error.log|"

< docs/man/nginx.8 > objs/nginx.8

gmake[2]: Leaving directory '/usr/local/src/openresty-1.19.3.1/build/nginx-1.19.3'

gmake[1]: Leaving directory '/usr/local/src/openresty-1.19.3.1/build/nginx-1.19.3'

三、安装

gmake install

这里不知道为啥跟步骤二返回一致,指南里是分步骤命令,但这里好像是gmake和gmake install 同时执行了

四、使用

从官方的入门使用教程中,感觉跟nginx本身单独安装并无二样;

nginx默认装在openresty安装目录下;可以完全看成一个单独的nginx,按照以前的经验使用;

openresty到底增强了nginx什么,需要在后续使用中发现;

安装就到此结束

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值