PHP talk to command line programs

The goal here is not to run PHP programs from the command line, but to talk to programs available on the command line, like at srv/local/bin, through your (web-based) PHP software.

Talk to the other server directly from PHP: Not installed by default.

On your server:

Making it much nicer: