Say you have a large PHP project and suddenly, when attempting to run it, you just end up with a blank page. The script terminates and you want to find exactly where that is with as little effort as possible.
Is there a tool/program/command/IDE that can, on PHP script termination, tell you the location of a script exit?
Note: I can't mark my own post as "accepted answer" so look at the bottom to see my solution. If you come up with a better solution I will mark your post as the answer.
Make sure that errors are displayed in your development environment (not production).
Add this to the top of the file:
See register_ shutdown_function()
Also check the error___logs for "
memory_limit
" errors in the Apache error_log.In my experience, scripts suddenly end without warning or notice when this happens.
Don't forget to grep for "exit" too.
I use the following code and need no special debugging environment. Note that this might take really long; you can set the ticks count higher - that makes it faster, but blurry.