exec() with Linux

exec() with Linux

am 05.11.2007 18:45:35 von Stefano

I have to execute vlc (Video Lan) using exec() function under Linux debian
distribution. Running vlc from a shell works perfectly, but I have a lot of
problems if it is executed with function exec:

TEST 1

$command = "vlc";
exec ($command);
?>

I get an error message in apache log file:

VLC media player 0.8.6c Janus
[00000287] skins2 interface error: Cannot open display
[00000287] skins2 interface error: cannot initialize OSFactory
Error: Unable to initialize gtk, is DISPLAY set properly?

What is the DISPLAY to set ? Please consider I am a newbie in Linux.


TEST 2

Same as before but running vlc with --daemon option. Now seems that vlc
process is running and I don't get any error message in apache log file, but
it does not record any input stream.



Is there anybody that can help me ?


Thank you.
Stefano

Re: exec() with Linux

am 06.11.2007 03:21:29 von unknown

Post removed (X-No-Archive: yes)

Re: exec() with Linux

am 06.11.2007 04:49:45 von darko

On Nov 5, 6:45 pm, "Stefano" wrote:
> I have to execute vlc (Video Lan) using exec() function under Linux debian
> distribution. Running vlc from a shell works perfectly, but I have a lot of
> problems if it is executed with function exec:
>
> TEST 1
>
> > $command = "vlc";
> exec ($command);
> ?>
>
> I get an error message in apache log file:
>
> VLC media player 0.8.6c Janus
> [00000287] skins2 interface error: Cannot open display
> [00000287] skins2 interface error: cannot initialize OSFactory
> Error: Unable to initialize gtk, is DISPLAY set properly?
>
> What is the DISPLAY to set ? Please consider I am a newbie in Linux.
>
> TEST 2
>
> Same as before but running vlc with --daemon option. Now seems that vlc
> process is running and I don't get any error message in apache log file, but
> it does not record any input stream.
>
> Is there anybody that can help me ?
>
> Thank you.
> Stefano

Think about executing another application in the web-environment: do
you think it would work if you tried to exec( "winword" ) (Microsoft
(R) Word)? Of course not. You can't just "run" an application from php
and have it shown in the browser window.

Re: exec() with Linux

am 06.11.2007 08:38:35 von Stefano

> You are probably on the right track, but it's going to be hard for anyone
> to help without knowing that program. Here's an idea: From a shell window,
> do "unset DISPLAY", then try to get the program to do what you want. Once
> you can do that, you can try it from the web server.

It doesn't work unsetting DISPLAY.
May be using vlc is not the right way to record a video stream in php. Do
you know other ways to do that ?