WhispPHP is a Pure PHP SSH server created by Ashley Hindle. It is the simplest way to build PHP SSH apps and allows you to run your Laravel Prompts apps through SSH with ridiculous simplicity.
If you are starting a new application, you can use the existing project template provided by Ashley, or you can add Whisp to an existing project using Composer:
composer require whispphp/whisp
Then start the Whisp server and provide the apps you would like to be made available:
<?php$server = new Whisp\Server(port: 2222); $server->run(apps: [ 'default' => 'path/to/app/helloworld.php', 'guestbook' => 'path/to/app/guestbook.php', 'chat-{roomName}' => 'path/to/app/chat.php',]);
You can also let Whisp auto-discover apps or provide a single default app:
// Auto-discovery - looks in the 'apps' directory and makes any apps there available$server->run(); // Pass a string with the default script that should always run$server->run('path/to/app/helloworld.php');
Test your apps locally with:
ssh localhost -p2222# orssh guestbook@localhost -p2222
Your users will access your apps remotely with the following:
ssh app@server# orssh server -t app
Ashley has created a few example apps for you to play with and plans to create a Laravel-specific package, starter kit and Docker image are in development, but as of this writing, they are still in development.
Learn more by reading the documentation and view the source code on GitHub.