本文介绍了PHP产生一个完全白页,没有错误,日志或标题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的专用WAMP PC上运行一些PHP代码时,我突然从服务器收到空白响应-实际上没有响应.没有标题,没有数据,PHP错误日志中没有内容,nada.我重新启动了APACHE和PHP,但是什么也没有.我知道php在工作,因为我可以很好地访问其他PHP脚本.

While running some PHP code on my private WAMP PC I'm suddenly getting a blank response from the server - no response actually. No headers, no data, nothing in the PHP error logs, nada. I restarted APACHE and PHP but still nothing. I know php is working because I can access other PHP scripts just fine.

Firebug报告没有标题,?个字节,并且只需 163ms 即可加载"(因此不是超时).我想到了快速的内存消耗-但我监视了PC的内存,并且没有出现任何峰值.到目前为止,错误和异常一直运行良好.

Firebug reports no headers, ? bytes, and it only takes 163ms to "load" (so it's not a timeout). I thought about rapid memory consumption - but I monitored my PC's memory and it's not showing any spikes. Errors and Exceptions have been working fine until now.

世界上什么?

max_execution_time = 30 ;
max_input_time = 60 ;
max_input_nesting_level = 64 ;
memory_limit = 500M ;

error_reporting = E_ALL | E_NOTICE | E_STRICT
display_errors = On
log_errors = On

:

我不会用十英尺高的杆碰到@.我认为红宝石家伙把它扔在那里,这样程序员就可以放弃PHP.

I wouldn't touch @ with a ten-foot-pole. I think the ruby guys throw that in there so programmers would drop PHP.

无论如何,我启用了xdebug,它没有输出任何研磨文件.然后,我接受了Zombat的建议,并在页面顶部放置了一个DIE(),它可以正常工作.我想我只有一些非常奇怪的代码,它们完全杀死了PHP.即使使用@禁用或抑制了错误,我仍然应该从服务器获取带有空内容的标头!

Anyway, I enabled xdebug and it didn't output any grind files. Then I took zombat's advice and placed a DIE() at the top of the page and it worked. I guess that I just have some very weird code that totally kills PHP. Even if errors were disabled or suppressed with @ I should still be getting back a header from the server with the empty content!

如果我发现更多信息,我会回发.

If I find more I'll post back.

推荐答案

我猜到了这个问题的答案-事实证明,PHP 5.2.5无法处理递归死亡.

I guessed the answer to this problem - it turns out that PHP 5.2.5 can't handle a recursive death.

<?php

class A
{
    public function __construct()
    {
        new B;
    }
}

class B
{
    public function __construct()
    {
        new A;
    }
}

new A;

print 'Loaded Class A';

没有标题,错误,内容,日志,xdebug转储,内存峰值,CPU峰值,服务器崩溃或任何其他情况.大约150毫秒之后,PHP才结束".很奇怪.

No headers, errors, content, logs, xdebug dumps, memory spikes, CPU spikes, server crashes, or anything. After about 150ms PHP just "ends". Weird.

这篇关于PHP产生一个完全白页,没有错误,日志或标题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 21:06