Quote:I made it almost like you but i don't use make install, just copy compiled file
Fine, any special reason to avoid make install though?
About the output thing, notice that you are using "$output" two times in your call. Change it to:
Quote:exec($cmd, $output=array(), $return);
And you're done. See that you were using "$output" at the left side of the assignation. The php manual for "exec()" clearly states that the return value is the last line of the command's output, so this was overwriting the values assigned inside the exec function (this is, $output was first getting an array with all the output as lineas, and then overwriten by only the last line, which is what you were getting).
Oh, and no, I don't think that redirecting stdout to a file would improve performance, quite the opposite in fact. Without redirecting, the output will be stored in memory only, whereas if you redirect it will go to the disk. Disk is slower than memory.... so at the end you would get worse performance.