Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the call stack from a Fatal Error?

Tags:

php

I'm getting a fatal "Call to a member function on a non-object" error in a PHP script, but I'm unable to track down exactly where this is happening, or why. The error message is pretty-much useless, as the line it describes works 99.9% of the time.

Is there a way I can get the current call stack, trace what calls are being made before this fatal error, or do anything else to help track down this bug?

like image 548
Phillip B Oldham Avatar asked Sep 03 '25 06:09

Phillip B Oldham


1 Answers

I would recommend installing Xdebug on your development server. It's a very valuable tool in cases like these.

like image 144
Jani Hartikainen Avatar answered Sep 04 '25 19:09

Jani Hartikainen