PDA

View Full Version : Start XBMC from apache webserver?


dlane99
2008-09-26, 15:31
I've just installed kubunt 8.04 and got xbmc from the package manager.
I've been using it for years on my xbox1 and have been very happy with it.
The iphone interface that uses the xbmc webserver is also very impressive.
I was just wondering if there is any way to start xbmc from apache?

My understanding is that when xbmc isnt running its webserver isnt running.
Apache and php5 seem to have been installed by default on my system.
So could the running apache be used to host a page that could execute a command similar to the restart command on the xbmc web interface?

Ive spent the last couple of hours looking at the code in default.asp and looking at php examples for executing linux commands but haven't gotten it working, I have no experience in linux, php or asp so it was unlikely that it would be able to do it but wanted to try before i posted here :;):

Is this possible?

or is it possible to have the xbmc server running in the background when xbmc is off? ( im guessing its probably not programmed this way so its unlikely.)

Thanks.

matt_cyr
2008-09-26, 20:09
http://ca3.php.net/manual/en/function.exec.php
should get you started...just give that command the path to xbmc and it should do what you need.

blubyu
2008-09-26, 20:39
This is the most basic of commands to get it to start.


<?
$cmd="/usr/share/xbmc/xbmc.bin";
echo exec ($cmd);
?>


I only tested it from the command line but I don't see why it wouldn't work from a web page.

d4rk
2008-09-26, 21:15
Remember to set the DISPLAY environment variable before launching.

althekiller
2008-09-26, 22:22
Probably best to wrap with a laucher script so you can block multiple instances too.