Flight PHP Framework
Flight is a fast, simple, extensible framework for PHP—built for developers who want to get things done quickly, with zero fuss. Whether you're building a classic web app, a blazing-fast API, or experimenting with the latest AI-powered tools, Flight's low footprint and straightforward design make it a perfect fit. Flight is meant to be lean, but can also handle enterprise architecture requirements.
Why Choose Flight?
- Beginner Friendly: Flight is a great starting point for new PHP developers. Its clear structure and simple syntax help you learn web development without getting lost in boilerplate.
- Loved by Pros: Experienced devs love Flight for its flexibility and control. You can scale from a tiny prototype to a full-featured app without switching frameworks.
- AI Friendly: Flight's minimal overhead and clean architecture make it ideal for integrating AI tools and APIs. Whether you're building smart chatbots, AI-driven dashboards, or just want to experiment, Flight gets out of your way so you can focus on what matters. The skeleton app comes with pre-built instructions files for the major AI coding assistants out of the box! Learn more about using AI with Flight
Video Overview
Quick Start
To do a fast bare bones install, install it with Composer:
composer require flightphp/core
Or you can download a zip of the repo here. Then you'd have a basic index.php
file like the following:
<?php
// if installed with composer
require 'vendor/autoload.php';
// or if installed manually by zip file
// require 'flight/Flight.php';
Flight::route('/', function() {
echo 'hello world!';
});
Flight::route('/json', function() {
Flight::json([
'hello' => 'world'
]);
});
Flight::start();
That's it! You have a basic Flight application. You can now run this file with php -S localhost:8000
and visit http://localhost:8000
in your browser to see the output.
Skeleton/Boilerplate App
There's an example app to help you start your project with Flight. It has a structured layout, basic configs all set and handle composer scripts right out of the gate! Check out flightphp/skeleton for a ready-to-go project, or visit the examples page for inspiration. Want to see how AI fits in? Explore AI-powered examples.
Installing the Skeleton App
Easy enough!
# Create the new project
composer create-project flightphp/skeleton my-project/
# Enter your new project directory
cd my-project/
# Bring up the local dev-server to get started right away!
composer start
It will create the project structure, setup the files you need, and you're ready to go!
High Performance
Flight is one of the fastest PHP frameworks out there. Its lightweight core means less overhead and more speed—perfect for both traditional apps and modern AI-powered projects. You can see all the benchmarks at TechEmpower
See the benchmark below with some other popular PHP frameworks.
Framework | Plaintext Reqs/sec | JSON Reqs/sec |
---|---|---|
Flight | 190,421 | 182,491 |
Yii | 145,749 | 131,434 |
Fat-Free | 139,238 | 133,952 |
Slim | 89,588 | 87,348 |
Phalcon | 95,911 | 87,675 |
Symfony | 65,053 | 63,237 |
Lumen | 40,572 | 39,700 |
Laravel | 26,657 | 26,901 |
CodeIgniter | 20,628 | 19,901 |
Flight and AI
Curious how it handles AI? Discover how Flight makes working with your favorite coding LLM easy!
Community
Contributing
There are two ways you can contribute to Flight:
- Contribute to the core framework by visiting the core repository.
- Help make the docs better! This documentation website is hosted on Github. If you spot an error or want to improve something, feel free to submit a pull request. We love updates and new ideas—especially around AI and new tech!
Requirements
Flight requires PHP 7.4 or greater.
Note: PHP 7.4 is supported because at the current time of writing (2024) PHP 7.4 is the default version for some LTS Linux distributions. Forcing a move to PHP >8 would cause a lot of heartburn for those users. The framework also supports PHP >8.
License
Flight is released under the MIT license.