php-fpm linux环境使用exec函数调用ffmpeg,报错ffmpeg: command not found的解决方法
原文链接:http://www.bowen-tech.top/articles/detail/25
php-fpm linux环境使用exec函数调用ffmpeg,报错ffmpeg: command not found的解决方法
<span> <span>打印具体报错命令</span></span>
<span> <span>0<span> <span>=><span> <span>‘sh: ffmpeg: command not found‘<span>,</span></span></span></span></span></span></span>
具体原因是通过PHP调用这个命令,没有引入对应的环境变量,导致找不到这个命令
解决办法
在PHP-fpm.conf的配置文件里面把下面几行前面的;去掉
我的PHP配置文件php-fpm.conf 在/usr/local/php/etc/php-fpm.conf ;
env[PATH]里面加入ffmpeg的路径,比如我的在/usr/local/ffmpeg/bin
<span>env<span>[<span>PATH<span>]<span> <span>=<span> <span>/usr/<span>local<span>/<span>bin<span>:<span>/usr/<span>bin<span>:<span>/bin:/usr<span><span>/local/ffmpeg/bin</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
相关推荐
dingwun 2020-11-16
wangdaren 2020-08-15
wqiaofujiang 2020-07-05
PGzxc 2020-07-04
ShoppingChen 2020-06-25
cherayliu 2020-06-17
83096129 2020-06-08
83096129 2020-06-08
PGzxc 2020-06-01
ShoppingChen 2020-05-29
cherayliu 2020-05-11
ShoppingChen 2020-05-11
83096129 2020-05-10
PGzxc 2020-05-07
cherayliu 2020-04-27
cherayliu 2020-04-11