Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing X programs

Status
Not open for further replies.

skottieb

Programmer
Jun 26, 2002
118
0
0
AU
does anyone know how i can execute an X program from
my browser using php, the program is on my local computer,
here's what i've come up with so far, it starts a process
i can see with `ps -A`, but there is no display on the
screen???
--------------------------------------------
system('vlc --display :0.0 > /dev/null');
echo "Playing";
--------------------------------------------

skottieb:)
 
X programs require an Xwindow system to display output. You can probably invoke it from PHP, but only output sent to standard out can be captured by PHP.

Is there a non-X version of the software you can invoke via PHP?

Want the best answers? Ask the best questions: TANSTAAFL!!
 
I do not want to capture the output of the program within php.
What i do want todo is load "vlc", a mpeg video viewer, with
the click of a button, for the moment i have set `xhost` to allow
any connection till i figure why it hangs on attempting to add
users.

So, to put it clearly, I just need PHP to command a X app
('vlc') to open in fullscreen and display the specified movie.
this can all be done from the command line
('vlc --display display_name --fullscreen "movie_to_play.mpg")

for the moment I am just concerned with getting the applivation
to load, i will implement the options at a later date, once
vlc actually loads.

thanx.

P.S. I can load the app as the apache user ( from a
console to X, but when called within a script the process still
appears but no X output :(:(:(

skottieb:)
 
I've had a similar concern in windows, so if you come up with anything, be sure to let us know.

But as far as my limited research has shown, items launched via exec or the backtick operator is always launched in a hidden mode, and stdout (stderr if redirected) is returned to the program. It can't be used to launch any kind of interactive or graphical program. Which makes sense considering what PHP is designed for, yet it would be nice sometimes to see what's going on when things start to hang, to know who I should blame, myself, php or the third party program.

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top