Answer the question
In order to leave comments, you need to log in
Debugging in phpStorm and stream output
Good day!
I'm trying to catch the annoying "Headers already sent by" using phpStorm.
Is there any way to output the STDOUT stream to the console or to variables?
I want to run through the debugger and find the place where the line break appears.
Answer the question
In order to leave comments, you need to log in
Well, “Headers already sent by” tells you where they have already been sent. You just need to look carefully there. Well, if possible, insert die () there and see what is displayed there in all its glory. Most likely some kind of warning or error
you can try calling the script from the console, past the web server:
$ php /path/to/index.php
STDOUT can be buffered and passed the value of the buffer to a variable.
<?php
ob_start();
...code...
$out = ob_get_contents();
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question