You could have the web application push jobs onto a queue and then run the queue worker locally on your computer. PHP can execute shell commands using the Symfony Process class, e.g. a pseudo-example:
$process = new Process(['print', $content]);
$process->run();
If you use the database for your queue, then this is a relatively simple solution providing you keep the local and remote code in sync.