跟踪PHP"内存不足"错误

Web*_*net 6 php debugging yii

我正在使用Yii框架构建应用程序,并且我正在尝试确定内存不足错误的原因.是否有可能获得堆栈跟踪?我尝试过像...这样的事情

function handleShutdown() {
    debug_print_backtrace();
    $error = error_get_last();
    $info = "[SHUTDOWN] file:".$error['file']." | ln:".$error['line']." | msg:".$error['message'] .PHP_EOL;
    echo $info;
}
register_shutdown_function('handleShutdown');
Run Code Online (Sandbox Code Playgroud)

但是debug_print_backtrace()除了显示任何内容之外没有显示任何内容

#0 handleShutdown()
[SHUTDOWN] file:C:\Users\bkuhl\htdocs\instaLabel\yii-1.1.12\base\CModule.php | ln:530 | msg:Allowed memory size of 67108864 bytes exhausted (tried to allocate 65488 bytes)
Run Code Online (Sandbox Code Playgroud)

我检查了CModule.php,该文件中没有行号530.它只到518.

Web*_*net 3

就我而言,发生这种情况是因为我有无限的函数递归。当我将 xDebug 扩展添加到 PHP 时,由于函数调用限制,它抛出了一个准确的错误。