Bug #71796 [Com]: exec cant work when the cmd is too long

From: Date: Thu, 17 Mar 2016 06:19:21 +0000
Subject: Bug #71796 [Com]: exec cant work when the cmd is too long
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199876@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71796&edit=1 ID: 71796 Comment by: g dot sokol99 at g-sokol dot info Reported by: hehu2012 at gmail dot com Summary: exec cant work when the cmd is too long Status: Open Type: Bug Package: *General Issues Operating System: Centos6.7 x86 PHP Version: 7.0.4 Block user comment: N Private report: N New Comment: Should it be closed? Previous Comments: ------------------------------------------------------------------------ [2016-03-17 06:06:39] hehu2012 at gmail dot com Thank you!I have resolved this question. It isnot a bug.I didnt add ffmpeg env ------------------------------------------------------------------------ [2016-03-11 12:11:26] g dot sokol99 at g-sokol dot info Do you use "ffmpeg" instead of "`fmpeg"? ------------------------------------------------------------------------ [2016-03-11 11:35:07] hehu2012 at gmail dot com Description: ------------ I use exec("`fmpeg -i /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.mp4 -y -f mjpeg -ss 3 -t 0.001 -s 640x1136 /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.jpg") in php file, it doesn't work. But I use exec("whoami"), it work well. When I use fmpeg -i /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.mp4 -y -f mjpeg -ss 3 -t 0.001 -s 640x1136 /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.jpg in command line it work well. But when I use exec("`fmpeg -i /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.mp4 -y -f mjpeg -ss 3 -t 0.001 -s 640x1136 /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.jpg") in php it doesn't work. Test script: --------------- exec("fmpeg -i /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.mp4 -y -f mjpeg -ss 3 -t 0.001 -s 640x1136 /var/www/ad-1/www/uploads/ad/v/5e/8f/98/88/5e8f98881c4da88fb31a1fe1b93c45d6.jpg") Expected result: ---------------- exec can work well when the cmd is long? Actual result: -------------- It return code 127 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71796&edit=1

« previous php.bugs (#199876) next »