title: sh: ffmpeg: command not found when run command through php
body: <p>I have installed successfully installed FFMpeg on root of my Centos 6 machine (<a href="https://trac.ffmpeg.org/wiki/CompilationGuide/Centos" rel="nofollow">https://trac.ffmpeg.org/wiki/CompilationGuide/Centos</a>). </p>
  
  <p>My workplace of apache/php is /var/www/html</p>
  
  <p>Now I'm running below command successfully on /var/www/html directory to capture frame from the video file. It's capturing a frame.</p>
  
  <pre><code>[root@localhost html]# ffmpeg -i video.mpg -an -ss 30  -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg -s 160x100 frame8  2&gt;&amp;1
  </code></pre>
  
  <p>I want to run this command through php and using shell_exec() or exec() php functions. My php code for running the command is:</p>
  
  <pre><code>$cmd = "/root/bin/ffmpeg -i /project/app/webroot/videos/video.mpg -ss 00:00:14.435 -f image2 -vframes 1 /project/app/webroot/videothumbnails/example-thumb.jpg";
  $locale = 'en_IN.UTF-8';
  setlocale(LC_ALL, $locale);
  putenv('LC_ALL='.$locale);
  echo shell_exec($cmd);
  </code></pre>
  
  <p>When I'm trying to run command through above php code, I'm getting below error:</p>
  
  <pre><code>sh: ffmpeg: command not found
  </code></pre>
  
  <p>Please help me to solve out this problem. </p>