PHP exec not executing command

前端 未结 4 1361
故里飘歌
故里飘歌 2021-01-06 09:21

I have used php\'s exec to execute FFmpeg command but its not woking when I open it in browser. But when i run this php file script in terminal it works fine.And my php safe

4条回答
  •  感动是毒
    2021-01-06 10:22

    Like @Arfeen mentioned in his answer, you should execute the command with the path of ffmpeg, but, the given path in the answer "/usr/bin/ffmpeg" is not always the same.

    First locate your ffmpeg by using the command :

    which ffmpeg
    

    The result in my case is :

    /usr/local/bin/ffmpeg

    Then go back to your php code and replace "ffmpeg" in the command by the path of ffmpeg (which is /usr/local/bin/ffmpeg in my case).

提交回复
热议问题