As I understand it, PHP's passthru displays the unadulterated output of the console - including all outputs, like STDERR. I'm trying to javac a file from a PHP file like so:
<?php
error_reporting(E_ALL);
if(file_put_contents("code.java", "aaaaaa"))
{
passthru("javac -verbose code.java");
echo("Done.");
}
else
{
echo("UNEXPECTED PHP ERROR");
}
?>
As you can probably guess, "aaaaaaa" should NOT compile - and this I expect output from the javac call (not to mention the -verbose). However, when I access the web page, I notice two things:
code.java is created successfully and filled with the data I specify.
The only output to the webpage is "Done."
Note that if I call the exact same command from the cmd prompt, I get a whole slew of output. What's going on here?
tl;dr; why am I not getting any output from passthru()?
EDIT: If I change the passthru command string to "echo PLEASEWORK" it displays outputs correctly
For some reason I can't comment - Quamis, what IS the prefered method of executing this cmd and capturing all output?