开发者

PHP exec() on windows not working

开发者 https://www.devze.com 2022-12-23 04:05 出处:网络
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

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);

开发者_StackOverflow社区Any suggestions?

Thanks!


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


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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消