I have a C# console app running on a linux server that uses Console.Write() to output its results to stdout. If I call it from the command line, it outputs its re开发者_如何学Pythonsults as expected, but when I call it from php using exec or passthru, nothing is written to stdout. In fact, the documentation on the System.Console class contains this note: "You should not use the Console class to display output in unattended applications, such as server applications." What is the correct way to write to stdout in this scenario?
When using the php exec command, redirect the output to an output array that you pass into it: http://php.net/manual/en/function.exec.php
精彩评论