Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-26-2005, 12:52 AM   #1
Registered: Nov 2004
Distribution: fc4
Posts: 104

Rep: Reputation: 15
[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/' $tempOrigVideo ' -ar 22050 /home/httpd/vhosts/' $uploadedVideo;

$execVideo '/usr/local/bin/ffmpeg ' $flags;
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

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


Last edited by dtra; 04-26-2005 at 02:33 AM.
Old 04-26-2005, 07:19 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 250Reputation: 250Reputation: 250
Re: [php] accessing command line

Originally posted by dtra
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:

$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..



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing command line arguments from a library function? tojo2 Programming 3 05-25-2005 03:56 PM
Command Line PHP in Slack 10 Trano Slackware 4 02-12-2005 05:16 PM
Command Line PHP on Mandrake Dilireus Linux - Software 2 08-04-2004 05:46 PM
php from command line odious1 Linux - Software 4 05-03-2004 12:31 AM
Accessing samba shares from command line paul.nel Linux - Software 4 01-24-2004 08:02 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration