I'm working in the shell with PHP, and I've found a way to make it take input from other servers and act on them via an input buffer (an IRC bot, for example) but is there a way to get php to idle and listen on a port? Maybe to make a sort of shell server, but in PHP?
Maybe with combination of sleep() and set_time_limit()? Like
while (!$done) { ...do whatever... set_time_limit(10); sleep(1); }
Don't know - never tried. :-) You can also play with cron - depending on what you need.
Actually, PHP has a bunch of optional, unstable functions in the socket() family... they're very sketchily documented in the php manual (http://php.net) I found a class that sort of scratches the surface with them... for anyone who cares, it's http://www.oddbytes.com/psr_lib.phps there.