我正在使用Apache/PHP/MySQL堆栈。
使用CakePHP作为框架。
有时我会收到一张空白的白页。我不能通过Cake调试它,所以我偷看了一下apache error.log,我得到了以下结果:
[Wed Oct 12 15:27:23 2011] [notice] child pid 3580 exit signal Segmentation fault (11)
[Wed Oct 12 15:27:34 2011] [notice] child pid 3581 exit signal Segmentation fault (11)
[Wed Oct 12 15:30:52 2011] [notice] child pid 3549 exit signal Segmentation fault (11)
[Wed Oct 12 16:04:27 2011] [notice] child pid 3579 exit signal Segmentation fault (11)
zend_mm_heap corrupted
[Wed Oct 12 16:26:24 2011] [notice] child pid 3625 exit signal Segmentation fault (11)
[Wed Oct 12 17:57:24 2011] [notice] child pid 3577 exit signal Segmentation fault (11)
[Wed Oct 12 17:58:54 2011] [notice] child pid 3550 exit signal Segmentation fault (11)
[Wed Oct 12 17:59:52 2011] [notice] child pid 3578 exit signal Segmentation fault (11)
[Wed Oct 12 18:01:38 2011] [notice] child pid 3683 exit signal Segmentation fault (11)
[Wed Oct 12 22:20:53 2011] [notice] child pid 3778 exit signal Segmentation fault (11)
[Wed Oct 12 22:29:51 2011] [notice] child pid 3777 exit signal Segmentation fault (11)
[Wed Oct 12 22:33:42 2011] [notice] child pid 3774 exit signal Segmentation fault (11)
这个分段故障是什么,我如何修复它?
更新:
PHP Version 5.3.4, OSX local development
Server version: Apache/2.2.17 (Unix)
CakePhp: 1.3.10
发布于 2011-10-13 18:15:52
将gdb附加到httpd子进程之一,重新加载或继续工作,等待崩溃,然后查看回溯。这样做:
$ ps -ef|grep httpd
0 681 1 0 10:38pm ?? 0:00.45 /Applications/MAMP/Library/bin/httpd -k start
501 690 681 0 10:38pm ?? 0:00.02 /Applications/MAMP/Library/bin/httpd -k start
..。
现在将gdb附加到其中一个子进程,在本例中为PID 690 (列为UID、PID、PPID ...)
$ sudo gdb
(gdb) attach 690
Attaching to process 690.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ....................... done
0x9568ce29 in accept$NOCANCEL$UNIX2003 ()
(gdb) c
Continuing.
等着撞车吧。然后:
(gdb) backtrace
或
(gdb) backtrace full
应该能让你知道发生了什么事。如果你提交了一个错误报告,你应该包括回溯。
如果崩溃很难重现,那么将Apache配置为只使用一个子进程来处理请求可能是个好主意。配置如下所示:
StartServers 1
MinSpareServers 1
MaxSpareServers 1
发布于 2011-10-13 03:46:12
分段错误是php (或者apache,可能性较小)中的内部错误。通常,分割错误是由较新的和较少测试的php模块之一引起的,例如imagemagick或subversion。
尝试禁用所有不必要的模块(在php.ini
中),然后逐个重新启用它们,直到出现错误。你可能还想更新php和apache。
如果这还不能解决问题,你应该使用report a php bug。
发布于 2011-10-13 17:50:01
你有没有试过在你的php.ini中增加output_buffering?
https://stackoverflow.com/questions/7745578
复制相似问题