The program outputs to the printer port - I've checked and the program will only run under root - it seems no other user can get permissions to open a specific hardware address - I would put it in a cron script and make the cron run it very so often - but I need the change to be instant (well, as instant as possible) so that is no good.
Here's the C-code of the program I am using:
I don't know if its any help - I then just call this program using the exec() function inside php. If anybody knows a way of doing this from directly inside php I'd be glad to know!
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/io.h>
#define base 0x378 / printer port base address /
#define value 128 / numeric value to send to printer port /
main(int argc, char **argv)
{
if (ioperm(base,1,1))
fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);
outb(value, base);
}
Thanks,
Alex Brett
alex_brett@hotmail.com