Bug #71796 [Com]: exec cant work when the cmd is too long
[email protected] ("g dot sokol99 at g-sokol dot info")
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
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: PHP Language Specification
Operating System: Centos6.7 x86
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
Do you use "ffmpeg" instead of "`fmpeg"?
Previous Comments:
------------------------------------------------------------------------
[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