dth54864 2014-06-11 15:10 采纳率: 0%
浏览 87
已采纳

Apache连接重置与preg_split

I'm facing a very weird behavior with Apache/2.2.25 (Win32) and PHP/5.4.10,

I have this code

$content = <<<EOF
<UNICODE-WIN>
<Version:7><FeatureSet:InDesign-R2L><ColorTable:=<Black:COLOR:CMYK:Process:0,0,0,1>>
<DefineCharStyle:Character Style 1=<Nextstyle:Character Style 1><cTypeface:Bold Italic><cSize:19.000000><cCase:All Caps><cPosition:Normal><cKashida:Default>>
<DefineParaStyle:Paragraph Style 1=<Nextstyle:Paragraph Style 1><cTypeface:Bold Italic><cCase:All Caps>>
<DefineParaStyle:NormalParagraphStyle=<Nextstyle:NormalParagraphStyle>>
<ParaStyle:Paragraph Style 1><CharStyle:Character Style 1>Text Sample Text Sample Text Sample
<CharStyle:><ParaStyle:Paragraph Style 1>
<ParaStyle:NormalParagraphStyle><CharStyle:Character Style 1>
<CharStyle:><ParaStyle:NormalParagraphStyle>Text Sample Text Sample Text Sample Text Sample .
<CharStyle:><ParaStyle:NormalParagraphStyle>aa aaaaa aaaa  \\\<bbbbbbb\\\\\>cccccc
<ParaStyle:NormalParagraphStyle>
Text Sample Text Sample Text Sample Text Sample Text Sample Text Sample
<ParaStyle:NormalParagraphStyle><CharStyle:Character Style 1>Text Sample
<CharStyle:><ParaStyle:NormalParagraphStyle>
Text Sample Text Sample Text Sample Text Sample Text Sample
<ParaStyle:NormalParagraphStyle>Text Sample Text Sample Text Sample Text Sample
<ParaStyle:NormalParagraphStyle><CharStyle:Character Style 1><cNextXChars:Column>
<CharStyle:><ParaStyle:NormalParagraphStyle><cNextXChars:Column>
<ParaStyle:NormalParagraphStyle>Text Sample Text Sample
<ParaStyle:NormalParagraphStyle>
EOF;
$regex         = '/((<(([^<>]|<[^<>]*>)*)>\s*)+)/s';
$parts         = preg_split( $regex, $content, null, PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_NO_EMPTY );

And for some reason when I execute this code it results in connection reset page in the browser, no error log in Apache or PHP

Did some research online but could not find good solution for it,

Here's a link of the results of phpinfo page on the Windows server

Also please ntoe that I run the same code on other servers Windows and CentOS and it works just fine

Appreciate your help

  • 写回答

1条回答 默认 最新

  • duananyu9231 2014-06-15 09:03
    关注

    I was able to fix this issue by increasing ThreadStackSize to 8 MB instead of its default Windows value of 1 MB, you just need to add these lines into Apache conf file

    <IfModule mpm_winnt_module>
       ThreadStackSize 8388608
    </IfModule>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能