Different behavior between command line and php on site

41 views
Skip to first unread message

Brian

unread,
Nov 3, 2009, 1:30:39 AM11/3/09
to ffmpeg-php
I have a php script which executes a simple line, basically I am doing
this:

ffmpeg -y -i $HOME/image1.jpg $HOME/image1.flv

(I know that it may appear that I am going at this bass-ackwards, but
trust that I have a reason for this madness.)

The problem is that this works from the command line, but it does not
work in my script.

I can execute this line in a PHP script and it does work:
ffmpeg -y -i $HOME/video1.avi -vcodec flv -r 29.97 -sameq -acodec
libmp3lame -ar 22050 -ab 32 -f flv -s 640x420 $HOME/video1.flv

All of my environment variables are the same between what I export in
my script and what are set when I login. The script executes so I know
it's not a permissions issue. I just don't understand why the command
will run on the command line and it won't run when I execute it via a
browser.

I appreciate any insight you can offer.

Brian

unread,
Nov 3, 2009, 1:07:10 PM11/3/09
to ffmpeg-php
To clarify further, if I open an ssh terminal to my server and copy/
paste the line on the command line it works as I would hope. If I
create a PHP script and execute that from the command line "php
temp.php" it works as I would hope. If I hit the file from a browser
(www.mysite.com/temp.php) that is when it does not work.

The only thing that I can guess that is different is that there is
something about the user permissions between my login and what the php
"user" has. I am exporting all of the paths in the php file and since
it works when I run it from the command line I don't think I am
setting any of the environment variables incorrectly.

I just need a little more information on what else to look at.
Reply all
Reply to author
Forward
0 new messages