Getting Started
Installation
Requirements
- PHP 8.2 or higher
- Composer 2.0+
- ext-json, ext-mbstring
Install via Git
StrataPHP installs like any other PHP package. No global binaries needed.
git clone git@github.com:lazysod/strataphp-public.git
This installs the latest stable version from our public repo, the docs have full install instuctions
Your First App
Create public_html/index.php:
<?php
require __DIR__ . '/../vendor/autoload.php';
use Strata\App;
$app = new App();
$app->get('/', fn() => 'Hello, Strata');
$app->run();
Run it locally
For quick testing, use PHP's built-in server:
php -S localhost:8000 -t public
Then open http://localhost:8000 in your browser. You should see "Hello, Strata".
Or use XAMPP / MAMP and point the document root to public_html/.
Note: The built-in server is for development only. For production, use Nginx, Apache, or FrankenPHP with PHP-FPM.
Directory Structure
StrataPHP uses PSR-4 autoloading mapped to public_html/ for shared hosting compatibility:
your-project/
├── public_html/ ← Web root
│ ├── index.php ← Front controller
│ ├── app/ ← App\ (config, core)
│ ├── controllers/ ← App\Controllers\
│ ├── models/ ← App\Models\
│ ├── modules/ ← App\Modules\
│ ├── views/ ← Templates
│ └── themes/ ← Theme assets
├── storage/ ← Logs, cache, uploads (not web accessible)
├── vendor/ ← Composer dependencies
├── bin/ ← CLI tools
├── migrations/ ← Database migrations
└── composer.json
Note: storage/ lives outside public_html/ for security. Never put uploads or logs in a web-accessible folder.
Troubleshooting
Run
composer dump-autoload. Make sure you included require vendor/autoload.php at the top of your file.
v1.0 has just been released, small bug fixes are expected. We're under no illusion here, it's just the first stable base and we will be making more and more changes as we go. You can join the community on our discord and get involved!