Rich Harrington
Rich Harrington

Reputation: 11

PHP exec() on windows not working

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!

Upvotes: 1

Views: 12959

Answers (4)

Ben Reisner
Ben Reisner

Reputation: 662

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

Upvotes: 0

dusoft
dusoft

Reputation: 11479

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

Upvotes: 0

soulmerge
soulmerge

Reputation: 75774

  1. You are missing a space at the end
  2. You should really use escapeshellarg()

Upvotes: 12

Pekka
Pekka

Reputation: 449813

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  ....

Upvotes: 1

Related Questions