I installed the version from http://ffmpeg.org/releases/ffmpeg-2.5.3.tar.bz2 and also tried the yum version but it is not new enough for youtube-dl.
I tried export PATH=$PATH:/usr/local/bin/ffmpeg
and PHP/Apache still cant find FFmpeg.
Apache user runs PHP script on CentOS 6.5.
Calling my youtube-dl.php from php command line as root works (with FFmpeg)
Calling my youtube-dl.php from php apache user works (not with FFmpeg)
What I am trying to do: shell exec youtube-dl (youtube dl calls FFmpeg in its binary code which there is now to modifiy it to add the full path). This works but the FFmpeg part my youtube-dl.php file
$output = shell_exec('youtube-dl -o "/home/test/%(title)s.%(ext)s" '.$url.' -f bestvideo+bestaudio 2>&1');
echo "<pre>$output</pre>";
# which ffmpeg
/usr/local/bin/ffmpeg
Someone on other pages on this site says local/bin is for customized versions but I downloaded it directly from FFmpeg and did the standard ./configure make install.
Done:
chmod 755 to /usr/local/bin/ffmpeg
Running FFmpeg as a test command directly (sometimes works and doesn't as I upgraded/rebooted/updatedb/etc)
$output = shell_exec('ffmpeg 2>&1');
echo "<pre>$output</pre>";
Result:
<pre>sh: ffmpeg: command not found</pre>
I read all of these similar questions but they didn't help:
FFMPEG PHP does not seem to work
FFmpeg not working
Recording audio with FFMPEG works in terminal but not through exec() of PHP
ffmpeg-php permission denied on localhost
C++ program from PHP not working properly
FFMPEG works from command line but not PHP
Calling a shellscript from php - not working correctly
PHP Internal Server Error 500 when using ffmpeg to convert files
PHP code not proceeding to the line after exec ffmpeg
ffmpeg not working from php script but works from command line
PHP exec() Not Working With ffmpeg
ffmpeg not work with PHP exec()
ffmpeg php exec not working
shell_exec
fail? Do you get some error message? If you don't, try capturingstderr
from shell_exec and see what it contains. – jsalonenffmpeg: command not found
so ou need to make sure shell can accessffmpeg
. See for instance: unix.stackexchange.com/questions/26047/… – jsalonenPATH
is bogus; it should be/usr/local/bin
. What output do you get when you run/usr/local/bin/ffmpeg
? – phihag