Installation

Requirements

  • PHP 8.3 or higher
  • Composer 2.0+
  • ext-json, ext-mbstring

Install via Composer

StrataPHP installs like any other PHP package. No global binaries needed.

composer require lazysod/strataphp

This installs the latest stable version from Packagist.

composer config repositories.strata vcs https://github.com/lazysod/strataphp-public
composer require lazysod/strataphp:dev-main

Use this if you want the latest unreleased code from GitHub.

Your First App

Create public/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

Strata doesn’t force a structure, but this is a good start:

your-project/
                ├── public/
                │   └── index.php        ← Web entry point
                ├── src/                 ← Your app code, PSR-4 autoloaded
                ├── vendor/              ← Composer dependencies
                ├── composer.json
                └── .env                 ← Config, optional

Troubleshooting

Run composer dump-autoload. Make sure you included require vendor/autoload.php at the top of your file.

v1.0 hasn’t been released yet. Use the “Dev Version” tab above to install from Git directly until the first tag is pushed.