Problem with linux command line

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
inigonirmal
Forum Newbie
Posts: 2
Joined: Tue May 30, 2006 8:32 am

Problem with linux command line

Post by inigonirmal »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hai friends,
Plz solve my query if anybody knows.
i need to run command line statements(some external commands) in linux thro' php.

Code: Select all

ex: ffmpeg
it runs and shows the functions of the ffmpeg in the command prompt.

my problem is
i have to run this command thro' php.
ex:

Code: Select all

<?php

$res = shell_exec("ffmpeg");
echo $res;
?>

there was no o/p for the above coding.

after this process i have opened the log file for the server.

i have seen this line at the last
ffmpeg: Not Found
In the same directory where the php file presents, i have run the above command in the command prompt.

but it is not run thro' php.

any body knows abt this problem plz help me to solve...

is there any environment variable to set classpath for php like JAVA.

I am waiting for your greatest reply.

Thanks & Regards,
Inigo Nirmal


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Sounds like a permissions problem. Is ffmpeg executable by php's user?
defect
Forum Newbie
Posts: 8
Joined: Wed Jun 14, 2006 2:59 pm
Location: Stockholm, Sweden

Post by defect »

does shell_exec() use the $PATH system variable? otherwise you could try and use the whole path (eg. /usr/local/bin/ffmpeg).
Post Reply