Kodi Community Forum

Full Version: Start XBMC from apache webserver?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 Wink

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.
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.
This is the most basic of commands to get it to start.

Code:
<?
$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.
Remember to set the DISPLAY environment variable before launching.
Probably best to wrap with a laucher script so you can block multiple instances too.