I find good error handling and log files are the best starting point.

As I use ob_gzhandler() a lot of echo/var_dump() stuff gets lost and results in a blank page (as the compressed content becomes invalid). Here's a minimal example to hack away at: