LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   [php] accessing command line (https://www.linuxquestions.org/questions/linux-software-2/%5Bphp%5D-accessing-command-line-317172/)

dtra 04-26-2005 12:52 AM

[php] accessing command line
 
hi all

i am writing a script for video uploads with conversion
just want to see if this is possible

PHP Code:

$flags ' -i /home/httpd/vhosts/example.com/httpdocs/temp/' $tempOrigVideo ' -ar 22050 /home/httpd/vhosts/example.com/httpdocs/videos/' $uploadedVideo;

$execVideo '/usr/local/bin/ffmpeg ' $flags;
exec($execVideo); 

the script ends up looking like
"/usr/local/bin/ffmpeg -i /temp/video.avi -b 100 -vcodec mpeg4 -ar 22050 /final/video.mp4"

i can't seem to get that to work, i can run that command from the command line
i can run the php script from the command line and the file is output correctly
but when trying to run the command from a browser nothing happens

i can run a simple command like "ls" from the browser

i have tried chmodding everything to 777 but that didn't do anything
any ideas?
i've also tried chown, chgrp to apache for ffmpeg, but still nothing

safe_mode is off

[update]
nm, it was cos the original video file didn't have the permissions

thanks
dave

trickykid 04-26-2005 07:19 PM

Re: [php] accessing command line
 
Quote:

Originally posted by dtra
[update]
nm, it was cos the original video file didn't have the permissions

That's actually what I was going to suggest first while reading until I saw your update.

I think another way of doing this or running the command would be something like this so its all in one line and you wouldn't need to have the separate exec line:

Code:

$execVideo = system(''/usr/local/bin/ffmpeg ' . '$flags'');
Or something along those lines.. might even make your code look cleaner if you setup a variable for the path of the command or so on..

Cheers.


All times are GMT -5. The time now is 10:35 PM.