ApnaPHP
🚀 Version 1.0.0 Now Available
ApnaPHP

The Modern PHP
Framework

Build blazing fast web applications with Next.js inspired file-based routing, powerful validation, and Laravel-like elegance - all in pure PHP

route.apna.php
<?php
namespace App\Api\Users;

use ApnaPHP\Routing\Request;
use ApnaPHP\Routing\Response;
use App\Models\User;

class UsersHandler {
    public function GET(Request $request) {
        return Response::json([
            'success' => true,
            'users' => User::all()
        ]);
    }
}
30+
Validation Rules
Zero
Config Required
100%
PHP Native
Features

Everything You Need

Packed with features to help you build modern web applications faster

File-based Routing

Next.js inspired routing. Create routes by adding files - no configuration needed. Support for pages and API routes.

ORM with Auto-Migration

Laravel-like Eloquent ORM with automatic database migrations. Support for MySQL, PostgreSQL, SQLite, and MongoDB.

Middleware System

Hierarchical middleware for authentication, CORS, security, and custom logic. Easy to implement and manage.

Powerful CLI

Generate routes, models, migrations, and middleware with simple commands. Built-in development server.

Advanced Validation

Comprehensive validation system with 30+ rules including file uploads, conditional validation, and custom rules.

File Upload System

Secure file uploads with validation, public/private storage, and automatic path handling.

Error Handling

Beautiful error pages with stack traces, code preview, and helpful debugging information.

Console Logging

Built-in console logging system for debugging with console_info(), console_error(), and console_debug().

SEO & Metadata

Built-in metadata system with Open Graph and Twitter Card support for better SEO.

Layout System

Hierarchical layout system with automatic content wrapping and metadata merging.

Development Server

Built-in development server with hot reload for instant feedback during development.

Multi Database Support

Unified API for MySQL, PostgreSQL, SQLite, and MongoDB with easy database switching.

Dynamic Routes

Support for [id], [slug] parameters with automatic route matching and parameter extraction.

Zero Configuration

Works immediately with sensible defaults. No complex setup or configuration required.

DI Container

Dependency injection with service container for clean architecture

Template Directives

Optional Blade-like syntax support for @if, @foreach, @include directives (use plain PHP if preferred)

Database Layer

Query builder with support for MySQL, PostgreSQL, and MongoDB

Security Features

CSRF protection, XSS prevention, secure headers, and input sanitization

Form Handling

Easy form creation, validation, and processing with helper functions

Model System

Eloquent-inspired models with relationships and query scopes

✨ Code Example

Simple. Powerful. Elegant.

Create a complete API endpoint in seconds with clean, readable code that just works. No configuration needed.

File-Based Routing

Create routes by adding files. No configuration required.

Clean Syntax

Write beautiful, maintainable code with intuitive APIs.

Instant Results

See your changes instantly with built-in dev server.

View Full Documentation →
route.apna.php
<?php
namespace App\Api\Users;

use ApnaPHP\Routing\Request;
use ApnaPHP\Routing\Response;
use App\Models\User;

class UsersHandler {
    public function GET(Request $request) {
        return Response::json([
            'success' => true,
            'users' => User::all()
        ]);
    }
}
Quick Start

Get Started in Minutes

Three simple steps to launch your application

1

Install Dependencies

Install the framework using Composer

$ composer install
2

Create Your First Route

Generate a new page or API endpoint

$ php apna make:route about
3

Start Development Server

Run the built-in ApnaPHP server

$ php apna serve

Ready to build amazing things!

Your application is running at http://localhost:3000

View Documentation →
Why ApnaPHP

Built for Modern Developers

Experience the perfect balance of simplicity and power with ApnaPHP

Lightning Fast Development

Build complete PHP applications in hours, not days. File-based routing, powerful CLI commands, and zero configuration get you started immediately.

Learn more

Modern PHP Architecture

Next.js-inspired file-based routing, Laravel-like ORM, class-based API handlers, and hierarchical middleware system for clean, maintainable PHP code.

Learn more

Production Ready PHP

Built-in security features, advanced validation, error handling, multi-database support, and comprehensive CLI tools for enterprise-grade PHP applications.

Learn more
⭐ Best Choice

What You'll Love

  • Zero Configuration

    Start coding PHP immediately without complex setup

  • Laravel-like ORM

    Familiar Eloquent-style ORM with auto-migrations

  • Multi-Database Support

    MySQL, PostgreSQL, SQLite, and MongoDB support

  • Powerful CLI Tools

    Generate routes, models, migrations, and middleware instantly

Perfect For

  • PHP Startups & MVPs

    Launch your PHP product faster with rapid development

  • REST APIs

    Build robust PHP APIs with class-based handlers

  • Web Applications

    Full-stack PHP apps with file-based routing

  • Microservices

    Lightweight services with minimal overhead

Testimonials

What Developers Say

Real stories from developers who have built amazing applications with ApnaPHP

AK

Alex Kumar

Full Stack Developer

Tech Innovations Inc

ApnaPHP has completely transformed how I build PHP applications. The file-based routing is intuitive, and the Laravel-like ORM makes database operations a breeze. Highly recommended!

SW

Sarah Williams

Backend Engineer

StartupHub

The Next.js-inspired routing in ApnaPHP is brilliant! I can now build PHP APIs faster than ever. The automatic migrations and validation system are game-changers for rapid development.

MC

Michael Chen

Lead Developer

Digital Solutions Ltd

ApnaPHP's middleware system and error handling are top-notch. The framework is lightweight yet powerful, perfect for both small projects and enterprise applications.

PS

Priya Sharma

Software Architect

CloudTech Systems

The zero-configuration approach and built-in CLI tools make ApnaPHP incredibly developer-friendly. I've migrated three projects already, and the results are amazing!

DM

David Martinez

PHP Developer

WebCraft Agency

ApnaPHP brings modern development practices to PHP. The file upload system, validation, and beautiful error pages save hours of development time. Best PHP framework I've used!

EJ

Emily Johnson

Technical Lead

E-commerce Solutions

The multi-database support and clean syntax make ApnaPHP perfect for complex applications. Our team productivity has increased significantly since switching to ApnaPHP.

AK

Alex Kumar

Full Stack Developer

Tech Innovations Inc

ApnaPHP has completely transformed how I build PHP applications. The file-based routing is intuitive, and the Laravel-like ORM makes database operations a breeze. Highly recommended!

SW

Sarah Williams

Backend Engineer

StartupHub

The Next.js-inspired routing in ApnaPHP is brilliant! I can now build PHP APIs faster than ever. The automatic migrations and validation system are game-changers for rapid development.

MC

Michael Chen

Lead Developer

Digital Solutions Ltd

ApnaPHP's middleware system and error handling are top-notch. The framework is lightweight yet powerful, perfect for both small projects and enterprise applications.

PS

Priya Sharma

Software Architect

CloudTech Systems

The zero-configuration approach and built-in CLI tools make ApnaPHP incredibly developer-friendly. I've migrated three projects already, and the results are amazing!

DM

David Martinez

PHP Developer

WebCraft Agency

ApnaPHP brings modern development practices to PHP. The file upload system, validation, and beautiful error pages save hours of development time. Best PHP framework I've used!

EJ

Emily Johnson

Technical Lead

E-commerce Solutions

The multi-database support and clean syntax make ApnaPHP perfect for complex applications. Our team productivity has increased significantly since switching to ApnaPHP.

AK

Alex Kumar

Full Stack Developer

Tech Innovations Inc

ApnaPHP has completely transformed how I build PHP applications. The file-based routing is intuitive, and the Laravel-like ORM makes database operations a breeze. Highly recommended!

SW

Sarah Williams

Backend Engineer

StartupHub

The Next.js-inspired routing in ApnaPHP is brilliant! I can now build PHP APIs faster than ever. The automatic migrations and validation system are game-changers for rapid development.

MC

Michael Chen

Lead Developer

Digital Solutions Ltd

ApnaPHP's middleware system and error handling are top-notch. The framework is lightweight yet powerful, perfect for both small projects and enterprise applications.

PS

Priya Sharma

Software Architect

CloudTech Systems

The zero-configuration approach and built-in CLI tools make ApnaPHP incredibly developer-friendly. I've migrated three projects already, and the results are amazing!

DM

David Martinez

PHP Developer

WebCraft Agency

ApnaPHP brings modern development practices to PHP. The file upload system, validation, and beautiful error pages save hours of development time. Best PHP framework I've used!

EJ

Emily Johnson

Technical Lead

E-commerce Solutions

The multi-database support and clean syntax make ApnaPHP perfect for complex applications. Our team productivity has increased significantly since switching to ApnaPHP.

AK

Alex Kumar

Full Stack Developer

Tech Innovations Inc

ApnaPHP has completely transformed how I build PHP applications. The file-based routing is intuitive, and the Laravel-like ORM makes database operations a breeze. Highly recommended!

SW

Sarah Williams

Backend Engineer

StartupHub

The Next.js-inspired routing in ApnaPHP is brilliant! I can now build PHP APIs faster than ever. The automatic migrations and validation system are game-changers for rapid development.

MC

Michael Chen

Lead Developer

Digital Solutions Ltd

ApnaPHP's middleware system and error handling are top-notch. The framework is lightweight yet powerful, perfect for both small projects and enterprise applications.

PS

Priya Sharma

Software Architect

CloudTech Systems

The zero-configuration approach and built-in CLI tools make ApnaPHP incredibly developer-friendly. I've migrated three projects already, and the results are amazing!

DM

David Martinez

PHP Developer

WebCraft Agency

ApnaPHP brings modern development practices to PHP. The file upload system, validation, and beautiful error pages save hours of development time. Best PHP framework I've used!

EJ

Emily Johnson

Technical Lead

E-commerce Solutions

The multi-database support and clean syntax make ApnaPHP perfect for complex applications. Our team productivity has increased significantly since switching to ApnaPHP.

AK

Alex Kumar

Full Stack Developer

Tech Innovations Inc

ApnaPHP has completely transformed how I build PHP applications. The file-based routing is intuitive, and the Laravel-like ORM makes database operations a breeze. Highly recommended!

SW

Sarah Williams

Backend Engineer

StartupHub

The Next.js-inspired routing in ApnaPHP is brilliant! I can now build PHP APIs faster than ever. The automatic migrations and validation system are game-changers for rapid development.

MC

Michael Chen

Lead Developer

Digital Solutions Ltd

ApnaPHP's middleware system and error handling are top-notch. The framework is lightweight yet powerful, perfect for both small projects and enterprise applications.

PS

Priya Sharma

Software Architect

CloudTech Systems

The zero-configuration approach and built-in CLI tools make ApnaPHP incredibly developer-friendly. I've migrated three projects already, and the results are amazing!

DM

David Martinez

PHP Developer

WebCraft Agency

ApnaPHP brings modern development practices to PHP. The file upload system, validation, and beautiful error pages save hours of development time. Best PHP framework I've used!

EJ

Emily Johnson

Technical Lead

E-commerce Solutions

The multi-database support and clean syntax make ApnaPHP perfect for complex applications. Our team productivity has increased significantly since switching to ApnaPHP.

AK

Alex Kumar

Full Stack Developer

Tech Innovations Inc

ApnaPHP has completely transformed how I build PHP applications. The file-based routing is intuitive, and the Laravel-like ORM makes database operations a breeze. Highly recommended!

SW

Sarah Williams

Backend Engineer

StartupHub

The Next.js-inspired routing in ApnaPHP is brilliant! I can now build PHP APIs faster than ever. The automatic migrations and validation system are game-changers for rapid development.

MC

Michael Chen

Lead Developer

Digital Solutions Ltd

ApnaPHP's middleware system and error handling are top-notch. The framework is lightweight yet powerful, perfect for both small projects and enterprise applications.

PS

Priya Sharma

Software Architect

CloudTech Systems

The zero-configuration approach and built-in CLI tools make ApnaPHP incredibly developer-friendly. I've migrated three projects already, and the results are amazing!

DM

David Martinez

PHP Developer

WebCraft Agency

ApnaPHP brings modern development practices to PHP. The file upload system, validation, and beautiful error pages save hours of development time. Best PHP framework I've used!

EJ

Emily Johnson

Technical Lead

E-commerce Solutions

The multi-database support and clean syntax make ApnaPHP perfect for complex applications. Our team productivity has increased significantly since switching to ApnaPHP.

By The Numbers

Trusted by Developers Worldwide

Join the growing community of developers building amazing PHP applications

v1.0
Stable Version
Production Ready
4
Database Drivers
Multi-DB Support
30+
Validation Rules
Built-in Validators
100+
CLI Commands
Developer Tools
100%
Open Source
MIT Licensed
Zero
Configuration
Just Works
FAQ & Contact

Have Questions? We're Here to Help

Find answers to common questions or reach out to us directly

Frequently Asked Questions

ApnaPHP is a modern PHP framework inspired by Next.js file-based routing. It provides a clean, elegant way to build web applications with features like auto-migration ORM, powerful validation, middleware system, and built-in CLI tools.

Simply create a file in your app directory, and ApnaPHP automatically creates a route for it. For example, app/about/page.apna.php becomes /about route. API routes work similarly with route.apna.php files containing handler classes with GET, POST, PUT, DELETE methods.

ApnaPHP supports MySQL, PostgreSQL, SQLite, and MongoDB out of the box. You can easily switch between databases by updating your .env file. The unified ORM API works seamlessly across all supported databases.

Absolutely! ApnaPHP is production-ready with built-in security features, error handling, validation, and comprehensive middleware system. Many developers are already using it for real-world applications and APIs.

Getting started is simple! Just run 'composer create-project alsocoder/apnaphp my-app' to create a new project. Then 'cd my-app' and 'php apna serve' to start the development server. Your app will be running at http://localhost:3000

ApnaPHP requires PHP 8.1 or higher. We recommend using the latest stable PHP version for the best performance and security. The framework takes advantage of modern PHP features like attributes, enums, and typed properties.

Yes! ApnaPHP features automatic database migrations. Define your models with properties and attributes, and the framework automatically creates and updates database tables. No manual SQL needed!

While ApnaPHP works best as a standalone framework, you can integrate specific components like the Router, Validation, or ORM into existing projects by installing via Composer and following the integration guide in our documentation.

Get in Touch

Stay Updated

Get the latest updates, tutorials, and news about ApnaPHP

Weekly updates
No spam
Unsubscribe anytime