views:

118

answers:

2
+1  A: 

Are you passing the second output array parameter?

http://us2.php.net/manual/en/function.exec.php

string exec ( string $command [, array &$output [, int &$return_var ]] )

output

If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec().

Amber
I suspected this is his issue which is why I asked for code. Sorry, I'm out of upvotes for today!
Josh
No big deal, rep doesn't really have a huge meaning to me anymore. ;)
Amber
@Amber: I think I'd feel the same in your shoes. Over 10x as much rep as me and you've been on the site less time. Nice work :-)
Josh
A: 

I suspect you might be right that windows isn't liking the 2>&1 statement. What do you see when you try:

$output = array()
echo "Executing: [$path2sox/sox $cmd]";
exec("$path2sox/sox $cmd", $output, $result);
echo "Result: ";
var_dump($result);
echo "\n<br>Output: ";
var_dump(output);
Josh
japanitrat
Please edit your question and post the output you saw...
Josh
Since the result was 0, that would *appear* to indicate the call was successful. What happens when you run `I:\SoX/sox --guard -V4 "somedirectory/test.wav" --compression "320.2" "somedirectory/test.mp3"` under the commandline?
Josh
i get the debug output of SoX (about 40 lines) with information about the source file the encoder, etc.
japanitrat
What happens if you replace `somedirectory/test.wav` and `somedirectory/test.mp3` with absolute paths?
Josh
dude? are you trying to make fun of this? no offense but your answers seem kinda random .. what should change in the output when changing from relative to absolute paths?
japanitrat