[英]Wampserver doesn't bear php code with regex
Editing the whole question as i managed to narrow it down. 编辑整个问题时,我设法缩小了范围。 This is the code
这是代码
<?php
set_time_limit(0);
$file = file_get_contents("oui.txt");
preg_match_all("/[0-9ABCDEF]{6}(?=(?:.*?\s*)*CHINA)/", $file ,$out, PREG_PATTERN_ORDER);
var_dump($out);
?>
This code make wampserver 2.3 to show This webpage is not available but when i change the regex to any simpler for instance only [0-9ABCDEF]{6}
in this very code, it run smoothly. 这段代码使wampserver 2.3能够显示此网页不可用,但是当我将此正则表达式更改为更简单的正则表达式时,例如仅在此代码中仅使用
[0-9ABCDEF]{6}
,它就可以平稳运行。
When this error ocurr the apache_error.log file says this: 当发生此错误时,apache_error.log文件会说:
[Sun Mar 30 17:36:56 2014] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Sun Mar 30 17:36:56 2014] [notice] Apache/2.2.23 (Win32) PHP/5.4.9 configured -- resuming normal operations
[Sun Mar 30 17:36:56 2014] [notice] Server built: Aug 24 2012 11:30:00
[Sun Mar 30 17:36:56 2014] [notice] Parent: Created child process 2376
[Sun Mar 30 17:36:56 2014] [notice] Child 2376: Child process is running
[Sun Mar 30 17:36:56 2014] [notice] Child 2376: Acquired the start mutex.
[Sun Mar 30 17:36:56 2014] [notice] Child 2376: Starting 64 worker threads.
[Sun Mar 30 17:36:56 2014] [notice] Child 2376: Starting thread to listen on port 80.
Don't know if it have anything to do with the fact that it also shows errors when i try to access any folder; 不知道是否与我尝试访问任何文件夹时也会显示错误的事实有关;
[Sun Mar 30 17:36:30 2014] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://localhost/anyfolder/
I have no skype. 我没有Skype。 Thank you very much
非常感谢你
Your regex can be simplified with: 您的正则表达式可以通过以下方式简化:
preg_match_all(
"/[0-9ABCDEF]{6}(?=.*CHINA)/",
$file,
$out,
PREG_PATTERN_ORDER|PCRE_DOTALL
);
If preg_match entered some weird loop, this should solve the issue. 如果preg_match进入了一个怪异的循环,这应该可以解决问题。
The PCRE_DOTALL
makes the .
PCRE_DOTALL
使.
aware of linebreaks as well. 也知道换行符。
原来这是Windows XP上的wampserver的错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.