I was recently working with JpGraph and got the broken image of death that seemed to preclude debugging. After googling around for a debug flag, I found a lot of people with the same issue but incomplete solutions at best. I was sure I used such a flag to display error messages before, but I couldn’t find it.

Finally, I came across John Geddes’ blog, where I found the last piece of info I needed to print some debug output. If you’re having this problem, try this:

  1. Right click the broken image and go to Properties.
  2. Copy the address and load it in your browser. Make sure you copy the whole query string if applicable.
  3. Finally, remove $graph->Stroke() from your code, save and refresh.

At this point you should see an error message or a blank page. If the page is blank, you can start var_dumping to your heart’s content. Resume code-save-refresh loop.

Don’t forget to add that line of code back when you’re done. Thank you Mr. Geddes.