Hi All,
this is my first post in any forum, period! In fact, so far, any of my questions have been asked before and I could google the answer. This time I am stuck!
Here is my project: I wanted to stream my TV signal over the network, so that any of the computers attached could watch TV without having a TV Tuner card in it.
My solution so far: I put together an old P3-550 with a ATI TV Wonder Card, installed Fedora Core 4 & VideoLAN. I use XAWTV to set the channel I want to watch and let VideoLAN stream the signal. I installed KDE, but am using IceWM on it, since it is much leaner. I also access the box through VNC, which I have been using to change the channel.
What I wanted to do next: I wanted to write a quick PHP script (make it look like a remote control) to change the channels. There is a way to change the channel, through "xawtv-remote". The command is "xawtv-remote setchannel next" or "prev" or the number of the channel. Very simple really.
My Dilema: Well, I thought this would be real easy. Just write a PHP code like this:
<?php
if (isset($_POST["check"])) {
if ($_POST["channel"] == "Up") {
echo exec('/usr/bin/xawtv-remote setchannel next');
}
if ($_POST["channel"] == "Down") {
echo exec('usr/bin/xawtv-remote setchannel prev');
}
if ($_POST["channelnumber"] != "") {
echo exec('usr/bin/xawtv-remote setchannel '.$_POST["channelnumber"]);
}
}
?>
<hmtl>
<head>
<TITLE>TV Remote</TITLE>
</head>
<body><center>
<FORM method="POST" action="">
<INPUT value="send" name="check" type="hidden">
<INPUT type="submit" name="channel" value="Down"><br>
<INPUT type="submit" name="channel" value="Up"><br>
Or enter Channel #: <INPUT type="text" name="channelnumber" value="<?php if (isset($_POST["check"])) {
echo $_POST["channelnumber"];
}
?>"><INPUT type="submit" name="submit" value="Set"><br> </FORM>
</center>
</body>
</hmtl>
Now, all I get is an output of "1", evertime I send the channel change, but the channel doesn't change. If I type that command in a Terminal it does what it's suppossed to do.
I know that the command is proper (I played with it for hours, taking away the complete path, moving the file, changing the privileges of the file, etc.)
I even gave apache root privileges (so I think. I am unsure if I did it correctly, since it didn't work).
Well, I tried different PHP commands, such as "system", but nothing. I am not sure where the error lies, since it doesn't really give me an error, just "1".
I went and checked to see if the PHP.ini had anything turn on that would prevent the script from executing, but I know exec works, since I can "ls" the directory and get the files.
Then I went and checked the apache httpd.conf file to see if there is something amiss, but again, couldn't find anything. I even tried the "sudo" thing, changing the permissions with visudo.
Really, what is left to do?????????
I am up to try anything. If you have any clue what may be the problem here, let me know.
Gerrit