I'm attempting to run the following command in PHP (on Ubuntu):
<?php
if (exec("/home/johnboy/ffmpeg/ffmpeg -i test1.mp4 -acodec aac -ab 128kb -vcodec mpeg4 -b 1220kb -mbd 1 -s 320x180 final_video.mov"))
{ echo "Success"; }
else { echo "No good"; }
And I always get "No good" echoed back, and no file created.
Interestingly, if I run the same exact command in Shell, it works, no problems.
Also, when I run the same code above, but subsitute "whoami" instead of the ffmpeg stuff, it works. (It echoes back "Success")
Any ideas on why this wouldn't be working? Thanks.
get the stderr will give the result
try
ffmpeg -i inputfile [more_params] 2>&1
Can the apache/web user reach /home/johnboy/ffmpeg/ffmpeg
? That is, perhaps /home/johnboy
is 0700 instead of 0755?
Perhaps there are resource limits affecting loading of such a large program and all its libraries?
If you run the script to the php cli sapi, does it behave correctly? Even when running as the apache user?
What does strace -ff
show when the apache web user runs the php script through the php cli?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With