tags:

views:

64

answers:

4

Hey, I'm trying to execute a program on windows through PHP, the command is posted below. This doesn't seem to be running through the script at all, even though it works when the command is manually entered into the command prompt.

exec('C:\\ffmpeg -i ' . $movedfile . ' -acodec aac -ab 128k -vcodec libx264 -fpre C:\\ffmpeg\\share\\ffmpeg\\libx264-hq.ffpreset -crf 22 -threads 0 -wpredp 0' . $convertedfile);

Any suggestions?

Thanks!

A: 
exec('C:\ffmpeg -i  ....

this would mean you would have ffmpeg.exe in your C:\ root directory. I think you mean

exec('C:\ffmpeg\ffmpeg -i  ....
Pekka
no, it's located in my C root directory for testing purposes. I've also tried what plod suggested
Rich Harrington
$execvar = exec('C:\\ffmpeg -i ' . $movedfile . ' -acodec aac -ab 128k -vcodec libx264 -fpre C:\\ffmpeg\\share\\ffmpeg\\libx264-hq.ffpreset -crf 22 -threads 0 -wpredp 0' . $convertedfile);debug ($execvar);but there is no value within execvar
Rich Harrington
+3  A: 
  1. You are missing a space at the end
  2. You should really use escapeshellarg()
soulmerge
THANK YOU, that space is what was causing the problem. God, sometimes you just need another set of eyes to look over your code. Thanks a ton!
Rich Harrington
@Rich you can mark this answer as accepted using the check mark to the left.
Pekka
A: 

try running only the command itself without any options and see if that help. moreover try to run something simple first - dir etc.

dusoft
when I exec dir, it does return results:8 Dir(s) 549,287,497,728 bytes free
Rich Harrington
so exec works. there is some problem with the way you have your ffmpeg + options written.
dusoft
A: 

Did you check permissions? Assuming standard configurations, IUSR_MACHINENAME needs read + execute permissions to the executable, any source/output files, and any temporary directories/files

Ben Reisner
OP is under WIN!
dusoft
Yes... IUSR_MACHINENAME is a standard Windows system user that IIS uses to execute/access website files by default.
Ben Reisner