PHP frameworks

Every PHP framework has a job it does best.

We build, rescue and host applications in all of them - and in plain PHP that never had a framework - with a team that has written PHP for twenty-five years.

Which framework fits your project

Answer two questions. Each path ends where we would start - and says when we would choose something else.

What are you starting from?

A new project

What matters most?

A large system that several teams will work on for years

Where we would start

Symfony

Explicit configuration, a dependency-injection container, long-term-support releases and Doctrine for the data. The structure still holds when the fifth developer joins.

Also consider Laminas where the company already runs Zend Framework code.

A product that has to ship soon, with a small team

Where we would start

Laravel

Authentication, queues, mail, scheduling and an expressive ORM out of the box, with one convention for all of it.

Laravel at EGPHP
An API or a small service with one job

Where we would start

Slim

Routing, middleware and standard PSR-7 requests, and nothing you did not ask for. You choose the database layer and the container.

If the API will grow into a full product, Laravel or Symfony saves a rebuild later.

A small application on a modest server

Where we would start

CodeIgniter

A small footprint, little configuration and clear documentation. It runs well where resources are tight.

Many data screens, built quickly from the database

Where we would start

Yii · CakePHP

Yii generates models and CRUD screens with Gii; CakePHP bakes them from its conventions. Both turn a schema into working screens quickly.

The least framework overhead on every request

Where we would start

Phalcon

The framework is a compiled C extension, so very little PHP runs per request. It needs that extension installed on the server - we install it on ours.

Many shared hosts do not allow PHP extensions. Check before you choose it.

An application that already exists

What is it built on?

Plain PHP with no framework, or a very old PHP version

Where we would start

Rescue first

We make it safe and current before anything else, then decide together whether a framework is worth it.

How a rescue goes
Built on a framework, and it works

Where we would start

Keep the framework

We upgrade it, secure it and extend it in the framework it was written in. A rewrite is the last resort, not the first.

Built on a framework you want to leave

Where we would start

Migrate in steps

The old and the new application run side by side, and routes move across one at a time while the business keeps working.

How a migration goes

Side by side

What each framework is, what it is strongest at, and when we would think twice. None of them is wrong; each is right for a different job.

PHP frameworks compared
Framework What it is Data layer Strongest at Think twice if
Symfony Full-stack framework and reusable components Doctrine ORM Large, long-lived systems, with long-term-support releases A small site has to launch this week
Laravel Full-stack framework Eloquent Shipping a product fast, with queues, authentication and mail built in You want every piece wired explicitly
CodeIgniter Lightweight full-stack framework Query builder and simple models A small footprint on modest servers The project needs a large ecosystem of packages
Yii Full-stack framework Active Record Data-heavy screens generated with Gii, and caching Your team is new to it; its community is smaller
CakePHP Full-stack framework CakePHP ORM Convention over configuration, and code baked from the schema The application fights its conventions at every turn
Laminas Components, MVC and middleware frameworks; the successor of Zend Framework laminas-db or Doctrine Business systems already built on Zend Framework A small new project wants to move fast
Slim Micro-framework None built in - your choice APIs and small services The application needs sessions, forms and an admin from day one
Phalcon Full-stack framework delivered as a C extension Phalcon ORM with PHQL Very low overhead per request Your host cannot install PHP extensions

Laravel itself is built on several Symfony components, and most of these frameworks share the same PSR standards - moving code between them is less work than it looks.

Old PHP, brought back into shape

Code written years ago still earns money for many businesses. We make it safe and current without switching it off.

- $id = $_GET['id'];- $r = mysql_query("SELECT * FROM orders WHERE id = $id");- $order = mysql_fetch_assoc($r);+ $stmt = $pdo->prepare('SELECT * FROM orders WHERE id = ?');+ $stmt->execute([(int) $_GET['id']]);+ $order = $stmt->fetch(PDO::FETCH_ASSOC);
The mysql_ functions were removed in PHP 7. This one change makes the page run on current PHP and closes an SQL injection at the same time.
  1. Read it and run it

    A copy of the application running on a current server, and a written list of what breaks.

  2. Tests around what works

    Tests that record what the pages do today, so a change that breaks one is caught at once.

  3. PHP upgraded in steps

    One version at a time, with Rector for the mechanical changes and PHPStan to find what it missed.

  4. Security first

    Prepared statements, escaped output, passwords re-hashed, and sessions and uploads locked down.

  5. Then, if it pays, a framework

    New features go into a framework beside the old code, and old pages move across as they are touched.

Moving between frameworks, one route at a time

We do not stop the business for a rewrite. The old and the new application sit behind one web server, and each route moves when its replacement is ready.

  • /api/orders New application Moved
  • /account New application Moved
  • /checkout New application In testing
  • /reports Old application Waiting
  • /admin Old application Waiting
An example migration, half way through.

The switch is one line per route

# nginx
location /api/orders { proxy_pass http://new; }
location /account    { proxy_pass http://new; }
location /checkout   { proxy_pass http://new; }
location /           { proxy_pass http://old; }

A route that misbehaves goes back to the old application with the same one-line change, while we fix it.

Tell us what you are running

The framework, the PHP version and what worries you about it are enough to start. Every project is quoted after a short conversation.