Comments (10)
pcre信息如下:
[root@bgp176-148 pcre-8.31]# ./pcretest -C
PCRE version 8.31 2012-07-06
Compiled with
8-bit support only
UTF-8 support
Unicode properties support
No just-in-time compiler support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
from tengine.
直接把其中没法编译的正则抽取出来,利用pcregrep就没有问题
pcregrep '~^(?Pwww\p{N}+).example.com' test.log 没有报错
from tengine.
看起来是用自己编译的PCRE库? 编译选项是什么?
另外系统中没有默认的PCRE库?
你的Nginx编译选项是什么?
from tengine.
pcre编译选项:
./configure --enable-utf8 --enable-unicode-properties
系统中已经有默认的pcre库
nginx的编译选项
./configure --with-http_concat_module --with-http_slice_module --with-pcre=/home/wangbin/software/pcre-8.31
from tengine.
加了,貌似test还是只认老的版本
直接使用
./pcregrep '~^(?Pwww\p{N}+).example.com$' test.log
没有问题,但在test中就报错误。
不知道为啥test没有用最新版本的pcre
from tengine.
做了一个试验,
在http_server_name.t文件中如果把下面一行:
server_name "~^(?Pwww\p{N}+).example.com$";
改成
server_name "^(?Pwww\p{N}+).example.com$";
也就是去掉‘~’,测试就通过了。
之前报的错误可能有误导性,也有可能真是没有利用到最新版本的pcre。
还有我对perl不熟悉,为啥去掉‘~’就可以了,直接用
./pcregrep "~^(?Pwww\p{N}+).example.com$" test.log
也没有问题
还有,粘贴命令过来,好多被转义了,比如‘.'被转成了‘.',不要直接复制上面的命令去试验。
from tengine.
On 2012/9/28 18:13, bin wang wrote:
做了一个试验,
在http_server_name.t文件中如果把下面一行:server_name "~^(?Pwww\p{N}+).example.com$";
改成
server_name "^(?Pwww\p{N}+).example.com$";
也就是去掉‘~’,测试就通过了。
之前报的错误可能有误导性。
还有我对perl不熟悉,为啥去掉‘~’就可以了
波浪形不是正则库的符号,这是Nginx命令的一部分,以波浪形打头说明是正则的
虚拟主机域名,后面的才是真正编译的正则表达式。
Thanks
-YWB
from tengine.
我发现Nginx的auto脚本会自己去编译pcre库,而且用自己的编译选项,看 这里:
https://github.com/taobao/tengine/blob/master/auto/lib/pcre/make#L54
./configure --disable-shared $PCRE_CONF_OPT
刚刚我尝试在Nginx的configure里面加入编译选项,没有成功。--with-pcre-opt
选项是改变CC的编译选项,不是PCRE库的configure选项。
我现在想到的办法就是你自己编译PCRE库,覆盖老的PCRE库。
或者
你直接改auto脚本,在上述的configure脚本里面加入“--enable-utf8 --enable-
unicode-properties”选项。
原生的Nginx也有这个问题。
On 2012/9/28 17:18, bin wang wrote:
pcre编译选项:
./configure --enable-utf8 --enable-unicode-properties系统中已经有默认的pcre库
nginx的编译选项
./configure --with-http_concat_module --with-http_slice_module
--with-pcre=/home/wangbin/software/pcre-8.31—
Reply to this email directly or view it on GitHub
https://github.com/taobao/tengine/issues/80#issuecomment-8968787.
Thanks
-YWB
from tengine.
果然如你所料,现在ok了
from tengine.
不好意思,最近开始接触nginx,刚刚也遇到了这个问题。所以请问最终的解决方法是什么呢?我们需要手动更改/auto/lib/pcre/make文件么。谢谢。 @wangbin579
from tengine.
Related Issues (20)
- 关于tengine时间变量的问题 HOT 6
- 使用xquic 1.6.2时,编译tengine时报错 HOT 3
- 新版本tengine3+,lua 报错 HOT 4
- upstream keepalive配置在使用dyups更新upstream后失效问题 HOT 1
- trim on; not worked HOT 2
- Pls. refer to doc [Ngx_http_trim_filter](https://tengine.taobao.org/document/http_trim_filter.html) specifically. HOT 7
- 安装ngx_http_xquic_module模块报错:modules/ngx_http_xquic_module/ngx_http_xquic.c:24:37: fatal error: ngx_http_lua_ssl_certby.h: No such file or directory HOT 5
- quic端口无法访问,tengine启动有报错 HOT 4
- dubbo 连接瞬间超时 HOT 13
- Tengine ngx_http_reqstat_module在统计信息时出现问题
- nginx实现一个对外端口同时支持tls和quic协议访问(第四层,并非第7层 HOT 1
- Tengine是否支持QUIC以及是否支持在QUIC中使用国密套件? HOT 4
- ngx_stream_multi_upstream_module 应用示例 HOT 1
- Reverse proxy Too much Tcp Connection issue HOT 3
- Tengine with XQUIC will buffer the entire response body into RAM HOT 2
- Tengine 3.1.0 中 ngx_http_upstream_check_module 和 ngx_http_upstream_dynamic_module 配合使用 Bug HOT 1
- Tengine属于信创软件吗? HOT 1
- Support ssl_ciphers with Chinese SM2, SM3, SM4, ZUC and etc. in HTTP3 HOT 1
- tengine+xquic+tongsuo+QAT性能无提升
- YoReader 404 Not found HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tengine.