Skip to main content
S-PHP Logo S-PHP is a lightweight, simple MVC (Model-View-Controller) PHP framework designed to help developers build scalable and maintainable web applications. It’s perfect for those who need a quick start without the complexity of heavier frameworks.

Why S-PHP?

S-PHP offers the perfect balance between simplicity and functionality. Built with modern PHP standards, it provides everything you need to create robust web applications without the overhead of larger frameworks.

Lightweight architecture

Minimalistic design with only the core MVC features you need. No bloat, just pure functionality.

Easy setup

No complex configurations required. Clone the repository and start building in minutes.

Flexible routing

Handles URL-to-controller mappings effortlessly with support for dynamic routes and parameters.

MVC architecture

Clean separation of concerns with Models, Views, and Controllers for maintainable code.

Powerful CLI

Built-in command-line tool to generate controllers, models, middleware, and more.

Extensible

Easily extendable with additional features. Add middleware, custom services, and more.

Key features

Simple routing

Define routes with an intuitive, expressive syntax:
$router->get('/', HomeController::class, 'index');
$router->post('/login', AuthController::class, 'login');

Middleware support

Protect routes and add functionality with middleware:
$router->get('/dashboard', DashboardController::class, 'index', AuthMiddleware::class);

Template engine

Render views with built-in support for layouts and components:
View::render('home.index', ['user' => $user]);

CLI commands

Generate boilerplate code instantly:
php do controller UserController
php do model User
php do middleware AuthMiddleware

Requirements

S-PHP requires PHP 8.1 or higher with the mbstring and pdo extensions enabled.
  • PHP: 8.1 or higher
  • Extensions: ext-mbstring, ext-pdo
  • Web server: Apache, Nginx, or PHP built-in server
  • Composer: For dependency management

Next steps

Installation

Get S-PHP installed and running on your system

Quick start

Build your first application in minutes

Community and support

S-PHP is an open-source project inspired by Laravel’s elegance and simplicity. Contributions are welcome!
Found a bug or have a feature request? Visit the GitHub repository to open an issue or submit a pull request.

Build docs developers (and LLMs) love