Well, there are some days where you have problems that seems difficult to solve,
then a light just switches on in your brain and the solution is very silly and you wish you had come out with it sooner. I had this problem today, trying to run my PHPUnit tests
phpunit -c app/ in Symfony. I was having a
headers already sent problem.
headers_sent($filename, $line); print $filename; print line;
With this command you just can see the filename and the line when the headers were sent, so after reading a lot about bugs in some plugins and other stuff, I realise the problem was easier than expected, PHPUnit Printer was sending headers and trying to write to stdout and It was crashing because of that, just adding the flag
--stderr Write to STDERR instead of STDOUT fixed the issue! :-)
There are more useful command line options for phpunit so you could find something else useful.