PHPainfree2 Logo

The fastest, smallest PHP "framework" ever made. Quickly design fast, efficient, scalable websites in minutes, focusing on coding actual features rather than fighting with the framework.

Now with support for htmx!

No Complicated Methods

You already know PHP, so why learn an entirely new way of coding just to use some silly framework that will go out of fashion in a few years?

Simple PHP and a tiny library footprint stay out of your way and let you focus on the part of your web app that you need to work on--your features!

Ultra Fast

It's not 2004 anymore. PHP is actually fast as heck, and you can use it to create websites capable of serving millions and millions of requests per hour. However, as soon as you bring a giant web framework into the mix, you're adding all of the overhead of that framework into your application and slowing down your ability to serve content.

PHPainfree is intentionally small. You are a programmer, so program in just what you need. Don't get stuck with a bunch of stuff that someone else has decided that you might need.

Fast JSON APIs and htmx Support

Each controller is capable of ending execution before rendering a full HTML template. This allows you to use your controllers as a RESTful endpoint for a lightning-fast JSON API or to leverage the front-end framework htmx to send back HTML partials for highly interactive dynamic front-ends.

Read the Docs
Quickstart - Documentation | PHPainfree2

Quickstart Guide

Start building something cool in just a few minutes.

1. Grab the Source Code

git clone --depth=1 \
&& cd PHPainfree && rm -rf .git && cp development.env .env

Grab the current source code from Github, delete the .git/ folder, and copy the development.env file into .env.

The .env file will contain sensitive passwords and other essential private items (API keys, etc) and should never be checked into version control. A minimalistic version is included with the PHPainfree source code to allow you to connect to the Docker database configured in the local development environment.

2. Turn on the Docker Server

docker compose up

PHPainfree V2 comes with a Docker setup for speedy development. By default, the docker-compose.yml configuration will start up three containers:

  • phpainfree_dev - Apache+PHP container running your application.
  • phpainfree_db - MySQL container with a persistent storage volume.
  • phpainfree_phpmyadmin - PHPMyAdmin web application connected to phpainfree_db.

3. Code!

It's really as easy as that! You should have a webserver running the source code in this folder located at http://localhost:8888/ and you should see a complete clone of this website.

From here you can use this website as a starting point for simple web development projects, or you can wipe out almost everything and start your new project from scratch. PHPainfree has never been an "opinionated" framework, and really just provides some lightweight routing automation and some tools for persistent database connections.