Hi I'm using XDEBUG to debug my WordPress code, is it possible to view the page building up in the browser while debugging? At the moment the page just hangs until the debugging process is finished then displays the fully rendered page. Ideally I'd like to see the page building up bit by bit as I debug through the theme's code.

Depending on your IDE, you should be able to just step into/over the code and your breakpoints, and the output will be sent to the browser at the normal times during script execution. You can also use your IDE to watch variables and see their values.
–
Ian DunnFeb 12 '13 at 18:19

2 Answers
2

; Implicit flush tells PHP to tell the output layer to flush itself
; automatically after every output block. This is equivalent to calling the PHP
; function flush() after each and every call to print() or echo() and each and
; every HTML block. Turning this option on has serious performance implications
; and is generally recommended for debugging purposes only.
implicit_flush = On

I would also recommend to disable gzip and look for other output_buffering related options in php.ini.

Then you should be able to set break-points in the different rendering stages of your theme.

Thanks will try this. Judging by the lack of feedback on this question I understand that most developers do not do the kind of debugging I want to do. Most seem to be content with having the full page output at once. I think WordPress itself implements some caching which could complicate things.
–
drtanzJul 12 '12 at 23:49

I'm not a Wordpress Developer, but its not clear what you want to archive, do you want an idea when some code is executed? For this I'd use the xdebug profiler feature with kcachegrind, which gives you a nice call tree. For the flushing question, there could a lot of other factors play a role beside PHP itself, maybe the browser or a webserver.
–
mt_Jul 14 '12 at 12:52

As for caching, this should not matter as caching in Wordpress (without any 3rd-party plugins) is mostly a shortcut for time intensive queries and is only used punctual. It should not interfere with theme rendering or you should notice in the theme source-code.
–
mt_Jul 14 '12 at 12:54

"This answer was automatically flagged as low-quality because of its length and content", which I am sure you don't want. Can you provide a bit of an explanation of what this code does and why it might solve the problem.
–
s_ha_dum♦May 3 '13 at 19:48