PHP exec() function acting strange
Posted: Tue Feb 21, 2006 1:56 pm
I am trying to call a system command with the exec function and am getting a result which I don't really understand.
The first command I am using works perfectly:
This uses sox to calculate the max gain which a sound file can be increased by before clipping.
Now, after I get the correct value, I want to actually increase the gain, so I use:
This is where it gets a bit strange; Instead of the sox command executing in this case, it seems as though the shell is trying to execute the file contained in the $inputfile var, and so I get the following:
sh: line 1: /var/lib/asterisk/sounds/sphinx_1140504120.117.wav: cannot execute binary file
This has been driving me nuts for over a day, and I just can't think of a solution. I have changed php.ini so that all of the safe mode stuff is off.
Does anyone have any ideas?
Many thanks.
The first command I am using works perfectly:
Code: Select all
$norm = `/usr/bin/sox $inputfile -e stat -v 2>&1`;Now, after I get the correct value, I want to actually increase the gain, so I use:
Code: Select all
$result = `/usr/bin/sox -v $norm $inputfile $outputfile 2>&1`;sh: line 1: /var/lib/asterisk/sounds/sphinx_1140504120.117.wav: cannot execute binary file
This has been driving me nuts for over a day, and I just can't think of a solution. I have changed php.ini so that all of the safe mode stuff is off.
Does anyone have any ideas?
Many thanks.