我正在使用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.