A lightweight, browser-based terminal for shared hosting environments where SSH/Terminal access is blocked.
Most affordable shared hosting providers block SSH and Terminal access by default. This tool was built to solve that β providing a real terminal experience directly through the browser using PHP's execution functions.
Built & battle-tested on Indonesian shared hosting (cPanel, PHP 8.2, CloudLinux).
- π Password protected login screen
- π» Real-time AJAX execution β no page reload
- π
cdnavigation with persistent directory across commands - π Unlimited scroll history β scroll up to see all previous output
- β¬οΈβ¬οΈ Arrow key history navigation (like real terminal)
- π¨ Linux-like dark UI with green prompt
- π Smart PHP CLI detection β uses correct PHP binary, not web PHP
- π¦ Composer & Git & Laravel Artisan compatible
(work in progress)
Upload terminal.php to your public_html via cPanel File Manager or FTP.
Open the file and change on line 3:
define('PASS', 'your-secure-password');https://yourdomain.com/terminal.php
Since shared hosting blocks SSH, download Composer binary directly:
which php
# or use full path:
/opt/alt/php82/usr/bin/php --versioncurl -o composer.phar https://getcomposer.org/download/latest-stable/composer.pharOr with wget:
wget -O composer.phar https://getcomposer.org/download/latest-stable/composer.phar
β οΈ Do NOT usecurl ... | phporphp -r "copy(...)"on shared hosting
β it may execute via web PHP and output HTML instead of binary.
/opt/alt/php82/usr/bin/php composer.phar --version
# Composer version 2.x.xalias php='/opt/alt/php82/usr/bin/php'Now you can use php composer.phar normally.
Full workflow from zero to running Laravel β no SSH needed.
git clone https://github.com/username/your-laravel-repo.git .
# or update existing:
git pull origin mainCOMPOSER_HOME=/home/username/.composer /opt/alt/php82/usr/bin/php composer.phar install --no-dev --optimize-autoloaderIf
fileinfoextension error, either:
- Enable via cPanel β Select PHP Version β Extensions β fileinfo
- Or add flag:
--ignore-platform-req=ext-fileinfo
# Copy env file
cp .env.example .env
# Open and edit database config
nano .env
# or edit via cPanel File ManagerEdit these values:
APP_NAME=YourApp
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password/opt/alt/php82/usr/bin/php artisan key:generate/opt/alt/php82/usr/bin/php artisan migrateWith seeder:
/opt/alt/php82/usr/bin/php artisan migrate --seedFresh migration (reset all):
/opt/alt/php82/usr/bin/php artisan migrate:fresh --seed# Link storage
/opt/alt/php82/usr/bin/php artisan storage:link
# Clear & optimize all cache
/opt/alt/php82/usr/bin/php artisan optimize:clear
/opt/alt/php82/usr/bin/php artisan optimizechmod -R 755 storage
chmod -R 755 bootstrap/cacheAfter pushing code updates:
git pull origin main
COMPOSER_HOME=/home/username/.composer /opt/alt/php82/usr/bin/php composer.phar install --no-dev --optimize-autoloader
/opt/alt/php82/usr/bin/php artisan migrate
/opt/alt/php82/usr/bin/php artisan optimize:clear
/opt/alt/php82/usr/bin/php artisan optimizeNode.js workflow example will be added here, inshaAllah.
Enable these in cPanel β Select PHP Version β Extensions:
β
fileinfo β
mbstring β
curl
β
zip β
gd β
pdo_mysql
β
opcache β
xml β
openssl
β
json β
tokenizer β
bcmath
β
ctype β
intl β
sodium
β οΈ This file provides command-line access to your server. Handle with care.
Best practices:
- β Use a strong unique password
- β Delete the file after deployment is done
- β
Move to a hidden path (e.g.
/private/tools/) - β
Restrict by IP via
.htaccess:
<Files "terminal.php">
Order Deny,Allow
Deny from all
Allow from YOUR.IP.ADDRESS
</Files>- β Never expose on production long-term
- β Never commit with password in plain text
php-web-terminal/
βββ terminal.php # Single-file web terminal (AJAX-based)
βββ term.log # Command history log (auto-created, gitignored)
βββ README.md
| Hosting | PHP | Status |
|---|---|---|
| Indonesian Shared Hosting (cPanel) | 8.2 | β Working |
| CloudLinux + cPanel | 8.2 | β Working |
MIT License β Free to use, modify, and distribute.
If this helped you, give it a β on GitHub!