How do you display php output into phpstorm's console?

Currently there is no such option in PhpStorm: to show web server buffer (what was sent to the browser) when debugging web page (note: this should work ONLY when debugging).

Such option did exist for a very short period about 4 years ago (separate Script Output tab in the debugger tool window: http://youtrack.jetbrains.com/issue/WI-2826 ).. but had quite a few issues and it was removed until properly implemented.

http://youtrack.jetbrains.com/issue/WI-18214 --> http://youtrack.jetbrains.com/issue/WI-4466


On that video, especially around 2:05 as you have suggested, ordinary CLI script is executed (Run/Debug Configuration of PHP Script type is used) and therefore ALL such output can be easily caught (standard std output).

With CLI scipt it's easy -- IDE is the parent here (he one who initiated script execution) so std output can easily be collected. If you execute your web page script in CLI environment, you will get your HTML in normal console output.

With web page it works differently (the whole process): script output is first sent to the web server (parent) which in turn sends it to the browser. Since IDE does not directly participate in script execution, such interception can only happen during debugging where debugger can send a copy of collected script output back to IDE.


Most web frameworks buffer the output before sending the results to the webserver. To view the contents of this buffer, first insert a breakpoint at the desired location, then when the breakpoint is reached, then goto the Debug=>Console tab and execute the ob_get_contents() function. PHP's output buffering supported nested levels, so keep this in mind when choosing your breakpoint. Obviously if the CMS/framework doesn't use output buffering then this method doesn't apply.