我如何增加对阿帕奇的Windows 7下运行的堆栈大小? [英] How do I increase the stack size for Apache running under Windows 7?

查看:419
本文介绍了我如何增加对阿帕奇的Windows 7下运行的堆栈大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我得到堆栈溢出在Windows 7。

I think I am getting stack overflows running a cakePHP application on an Apache server under Windows 7.

推荐答案

此问题发生更频繁地在Windows平台上,因为较小Apache默认的堆栈大小。有在Windows上1 MB的默认堆栈大小,不像Unix / Linux平台8 MB。这可能是一个原因,为什么一些例如PHP脚本正常工作在Linux,但让Apache的崩溃在Windows上。

This problem happens more often on Windows platform, because of smaller Apache's default stack size. There is 1 MB default stack size on Windows, unlike 8 MB on Unix/Linux platforms. It could be a reason, why some for example PHP scripts works properly on Linux, but cause crash of Apache on Windows.

此外,飞机坠毁是无声的(分段故障的),没有错误消息,阿帕奇只是停止响应和重新启动子进程。浏览器获取任何数据并呈现一个空白页,所以这是一个有点难以确定什么是错的。

Furthermore, the crash is silent (segmentation fault), there is no error message, Apache just stops responding and the child process is restarted. Browser gets no data and renders a blank page, so it's a bit difficult to decide what's wrong.

这是PHP中的长定期​​EX pressions工作时的一个常见问题

有仅在Apache的错误日志,它告诉,子进程崩溃一项通知:

There is one notice in Apache's error log only, which tells, that child process crashed:

Parent: child process exited with status ... -- Restarting

要修改Apache的堆栈大小的最好方法是使用 ThreadStackSize 在Apache的配置文件中的指令。还有就是在 ThreadStackSize 指令Apache的文档中的描述:<一href=\"http://httpd.apache.org/docs/2.2/mod/mpm_common.html#ThreadStackSize\">http://httpd.apache.org/docs/2.2/mod/mpm_common.html#ThreadStackSize

The best way to alter the Apache's stack size is using the ThreadStackSize directive in the Apache's configuration file. There is a description of the ThreadStackSize directive in Apache's documentation: http://httpd.apache.org/docs/2.2/mod/mpm_common.html#ThreadStackSize

所以在Windows的威力影响到Apache的堆栈大小增加看起来是这样的:

So increase of the Apache's stack size on Windows might looks like this:

<IfModule mpm_winnt_module>
   ThreadStackSize 8388608
</IfModule>

这些行应把Apache的配置文件英寸为简单起见,你可以把它设置为的httpd.conf 。或者更好的(但不是必要的),把它设置为的httpd-mpm.conf 文件,并在的httpd.conf 的注释去掉这一行:

These lines should be put in the Apache's configuration file. For simplicity, you could put it to httpd.conf. Or better (but not necessary), put it to httpd-mpm.conf file and in httpd.conf uncomment this line:

Include conf/extra/httpd-mpm.conf

它设置Apache的堆栈大小为8 MB,所以它同Linux上的默认值。

It sets Apache's stack size to 8 MB, so it's the same as a default value on Linux.

不要忘了重新启动Apache! :)

这篇关于我如何增加对阿帕奇的Windows 7下运行的堆栈大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆