1. Go to this page and download the library: Download zowesoft/web-terminal library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zowesoft / web-terminal example snippets
$user = User::where('email', '[email protected]')->first();
$user->is_admin = true;
$user->terminal_token = bin2hex(random_bytes(32));
$user->save();
// Copy this token — you'll need it to log in to the terminal
echo $user->terminal_token;
// config/web-terminal.php
return [
'prefix' => 'admin', // URL prefix: /admin/terminal
'middleware' => ['web', 'auth'], // Applied to all terminal routes
'timeout' => 120, // Max seconds per command
'admin_column' => 'is_admin', // Column that marks admin users
'token_column' => 'terminal_token', // Column that stores the token
'blacklist' => [
'rm -rf /',
'rm -rf *',
// add more blocked commands here
],
'path' => '/usr/local/bin:/usr/bin:/bin', // Shell PATH for finding executables
];