PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > exec() with Linux
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
exec() with Linux

Réponse
 
LinkBack Outils de la discussion
Vieux 05/11/2007, 17h45   #1
Stefano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut exec() with Linux

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

<php
$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 me ?


Thank you.
Stefano


  Réponse avec citation
Vieux 06/11/2007, 02h21   #2
ljb
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exec() with Linux

onde@interfree.it 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
>
><php
> $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.


You are trying to run a program that needs to talk to the display. DISPLAY
is an environment variable that tells the graphics system (X11) where to
send output. You won't be able to run the program from a web server if it
needs DISPLAY.

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


You are probably on the right track, but it's going to be hard for anyone
to 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.
  Réponse avec citation
Vieux 06/11/2007, 03h49   #3
Darko
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exec() with Linux

On Nov 5, 6:45 pm, "Stefano" <o...@interfree.it> 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
>
> <php
> $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 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.

  Réponse avec citation
Vieux 06/11/2007, 07h38   #4
Stefano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exec() with Linux


> You are probably on the right track, but it's going to be hard for anyone
> to 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 ?


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h29.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10288 seconds with 12 queries