CMS / content platform12 min readNot archived on GitHub

Craft CMS: a structured-content PHP CMS

A guide to Craft CMS as a self-hosted, structured-content CMS product on Yii 2, covering its content model, Twig and GraphQL delivery, and what the official docs leave unstated.

PHP compatibility and project lifecycle

Unknown from the supplied source: specific Craft versions, PHP 8.4 or 8.5 support, and support status are not stated. The source says only that Craft runs best on the latest PHP and MySQL or Postgres versions and can use MySQL or PostgreSQL. Verify requirements in the official docs.

Official sources checked 2026-10-22. Browser lessons on this site run PHP 8.5.

Sources and evidence limits

It relies on one supplied source, the Craft CMS 5.x documentation landing page. Where that page is silent, this guide says the answer is unknown rather than guessing.

What Craft is

The documentation describes Craft as a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. It is a content management product. It is not a PHP runtime, not a PHP extension, and not a replacement interpreter. PHP core is the language and its engine. Craft is an application written in PHP, so it runs on top of whatever PHP environment you provide.

The source highlights these traits:

  • A control panel for content creation and administrative tasks.
  • A clean-slate approach to content modeling and front-end development. Craft makes no assumptions about your content or how it should be delivered.
  • An official Plugin Store with free and commercial plugins.
  • A framework for plugin development.
  • An active community.

The focus of this guide is structured content. You define the shape of your content yourself instead of accepting a fixed model such as pages and posts.

Architecture

The source gives a short tech summary. Craft is a self-hosted PHP application built on Yii 2. It can connect to MySQL and PostgreSQL databases for content storage. Server-side rendering uses Twig. Headless applications can read content through a GraphQL API.

This distinction matters. Yii 2 is a framework, a set of components for building applications. Craft is a CMS product built on that framework. Learning Yii does not teach you Craft's control panel or content model, and installing Craft does not mean you are writing a plain Yii application. Likewise, Craft is a different kind of thing from Drupal. Both are CMS products, but they have separate codebases and documentation, and this guide covers only Craft.

Content and execution model

The documentation points to a section on content and elements for content modeling. It also lists reference material for element types, field types, console commands, controllers, Twig features and configuration. The landing page does not define those terms in detail, so read them in the official docs before relying on any assumption.

There are two delivery paths:

  1. Server-side rendering with Twig templates, where Craft produces the pages.
  2. Headless delivery, where another application reads content through GraphQL.

The source does not say how Craft handles request lifetimes, and it does not mention persistent workers. Classic PHP request handling starts fresh state for every request and discards it afterward. A persistent worker keeps the process alive and reuses it across requests. If you ever run any PHP application in that mode, state can leak between requests. Typical sources include static properties, singletons, service containers, caches held in memory, open database connections and request-specific data stored in globals. Cleanup then means resetting or discarding that state between requests and recycling workers on a policy. Whether Craft supports such a mode is unknown from the supplied source. Do not assume it does. Swoole and Open Swoole are separate projects with separate documentation, and the Craft source does not mention either.

Practical use cases

From the source, reasonable fits include:

  • Sites where editors need a control panel and developers want freedom to model content.
  • Server-rendered sites using Twig.
  • Headless back ends that expose content to other front ends through GraphQL.
  • Projects that need plugins, either from the Plugin Store or built with Craft's plugin framework.

The source makes no claims about performance, scale or suitability for any specific workload, so treat those as unknown until you test them yourself.

Installation approach

The landing page tells readers to spin up a new project or upgrade an existing one. It points to a Tutorial for newcomers and a System Requirements page. The packet contains no installation commands, version numbers or PHP compatibility table, so this guide does not invent any. Follow the official Tutorial and System Requirements pages for the exact steps.

The source does say Craft runs best on the latest PHP and MySQL or Postgres versions and can be configured for most modern hosting platforms. This learning track uses PHP 8.4, with PHP 8.5 planned. Whether a given Craft release supports PHP 8.4 or 8.5 is unknown from the supplied source, so confirm it in the official requirements before choosing a version.

The example below is a small preflight script. It is not part of Craft and does not install it. It checks that your command-line PHP is 8.4 or newer and that a PDO driver for MySQL or PostgreSQL is loaded. Both database engines are named in the source. The 8.4 threshold comes from this learning track, not from a Craft requirement.

Strengths

  • The clean-slate content modeling approach suits projects with unusual content shapes.
  • Twig rendering and GraphQL cover both traditional and headless delivery.
  • The documentation separates concepts, development, configuration and reference material.
  • A plugin ecosystem and plugin framework are available.
  • Self-hosting means you control the infrastructure.

Limitations and unknowns

  • The supplied source does not state a current version, release dates, support windows, deprecations, licensing terms or prices. All of these are unknown here, and the lifecycle is marked unknown.
  • PHP compatibility for specific releases is unknown here.
  • The source does not cover persistent workers, Docker, or any particular web server.
  • Self-hosted means you handle hosting, backups, database administration and updates.
  • Commercial plugins exist, but their costs and licenses are not described.
  • As a full CMS product, Craft is heavier than a micro-framework or a static site tool when you only need a few routes.

Deployment

The source says only that Craft is self-hosted and configurable for most modern hosting platforms. Any deployment guidance beyond that, such as web server choice, file permissions, environment settings, queue handling and update procedure, is unknown from this packet. Read the official documentation. If you run PHP through FastCGI, keep it on a private interface and never expose it publicly. Bind any local development port to 127.0.0.1.

Where to go next

Start with the official Tutorial, then read the content and elements section for modeling, then front-end development for Twig and GraphQL. Use the extending section only after you understand the core model. All of this is reachable from the official documentation landing page listed in the links.

Practical examples

These examples have not been run in a live environment yet. Commands and versions follow the official documentation linked on this page; check them before relying on them, and report a problem if one does not work.

Host preflight check before following the official Craft setup

A standalone CLI script, not part of Craft and not an installer. It checks for PHP 8.4 or newer, per this learning track, and for a loaded PDO MySQL or PostgreSQL driver, since the source names those two databases. Run it before following the official Craft Tutorial and System Requirements. It is not a browser exercise.

preflight/check-host.php

<?php

declare(strict_types=1);

// Learning-track preflight. This is NOT Craft's own requirements check.
// Confirm Craft's real requirements in the official documentation.

$phpOk = PHP_VERSION_ID >= 80400;

$drivers = [
    'pdo_mysql' => extension_loaded('pdo_mysql'),
    'pdo_pgsql' => extension_loaded('pdo_pgsql'),
];

echo 'PHP version: ' . PHP_VERSION . PHP_EOL;
echo 'PHP 8.4 or newer (learning track): ' . ($phpOk ? 'yes' : 'no') . PHP_EOL;

foreach ($drivers as $name => $loaded) {
    echo $name . ': ' . ($loaded ? 'loaded' : 'missing') . PHP_EOL;
}

$anyDriver = in_array(true, $drivers, true);

if (!$anyDriver) {
    echo 'No MySQL or PostgreSQL PDO driver found.' . PHP_EOL;
}

exit($phpOk && $anyDriver ? 0 : 1);

Install and run

php --version
php preflight/check-host.php
echo $?

Expected behavior

The script prints the PHP version, whether it is 8.4 or newer, and loaded or missing for pdo_mysql and pdo_pgsql. It exits with status 0 only if PHP is 8.4 or newer and at least one driver is loaded, otherwise 1. A passing result does not prove Craft compatibility.

Requires the PHP CLI. It checks only the PHP version and two PDO drivers, not Craft's full requirements, Composer, web server or database connectivity. It does not install or run Craft.