PHP Web Framework Phalcon

Phalcon PHP Framework with MariaDB Using Podman
On 2 min, 58 sec read

Build a Fast PHP App with Phalcon and MariaDB Using Podman

Looking for a modern, lightning-fast PHP framework that's open source and easy to get started with? Let me introduce you to Phalcon, a powerful framework known for its speed — and today, I'll show you how to get it working with MariaDB inside Podman containers.

Whether you're brand new to PHP or want a modern setup for local development, this guide is for you.

What is Phalcon?

Phalcon is an open-source PHP framework that runs as a compiled C extension. This gives it a huge performance edge over traditional PHP frameworks written entirely in PHP.

Key Features:

  • Lightning-fast execution
  • Full-stack MVC framework
  • Built-in ORM, router, templates, and more
  • Easy integration with MariaDB and other databases

Installing Phalcon with MariaDB Using Podman

Let's walk through how to run Phalcon and MariaDB using podman-compose.

Step 1: Create the Project Structure

mkdir -p phalcon-db-demo/app
cd phalcon-db-demo

Inside app/, create a simple index.php file:

<?php
$pdo = new PDO('mysql:host=db;dbname=phalcon_db', 'phalcon', 'secret');
$stmt = $pdo->query("SELECT 'Hello from Phalcon + MariaDB!' AS message");
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo "<h1>" . htmlspecialchars($row['message']) . "</h1>";
?>

This script connects to MariaDB and outputs a message from the database.

Step 2: Create the docker-compose.yml for Podman

version: '3.8'

services:
  phalcon:
    image: ghcr.io/phalcon/cphalcon:v5.9.2-php8.4
    container_name: phalcon_app
    working_dir: /app
    command: php -S 0.0.0.0:8080
    volumes:
      - ./app:/app:z
    ports:
      - "8080:8080"

  db:
    image: mariadb:10.11
    container_name: phalcon_db
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=phalcon_db
      - MYSQL_USER=phalcon
      - MYSQL_PASSWORD=secret
    ports:
      - "3307:3306"
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:

Step 3: Start the Project

podman-compose up -d

Wait a few seconds, then open your browser to:

http://localhost:8080

You should see a message: "Hello from Phalcon + MariaDB!"

Screenshots + Live Screencast

Phalcon Compose Yaml File
Gnome Text Editor Displaying Phalcon App Compose YAML File

Phalcon App Index File
Gnome Text Editor Displaying Phalcon App Index File

Phalcon In Container
Command Line Running Of Phalcon Web Framework

Phalcon User Result
Web Browser Displaying Custom User Result

Phalcon User Result Styled
Web Browser Displaying Custom User Result Styled

🎥 Screencast here demonstrating setup and execution.

Phalcon Custom View Records In Web Browser

Want to Learn More About PHP?

If you're starting out or looking to boost your PHP skills, I've created several resources tailored to learners at all levels:

Learning PHP (eBook)

An easy-to-follow PHP guide perfect for beginners and self-learners.

Learning PHP (Online Course)

Includes lessons, exercises, and real-world PHP coding examples — ideal for students and career switchers.

One-on-One Programming Tutorials

Need help on a project or want private instruction? Contact me directly for customized PHP coaching.

Wrap-Up

Phalcon is a smart choice if you're building modern, fast PHP applications. Combined with Podman and MariaDB, it creates a lightweight, containerized development workflow that's easy to replicate and scale.

Try the steps above and let me know how it goes! If you need help, drop a comment or reach out — I'm here to help you learn and grow as a developer.

Happy coding!

🚀 Recommended Resources


Disclosure: Some of the links above are referral links. I may earn a commission if you make a purchase at no extra cost to you.

About Edward

Edward is a software engineer, author, and designer dedicated to providing the actionable blueprints and real-world tools needed to navigate a shifting economic landscape.

With a provocative focus on the evolution of technology—boldly declaring that “programming is dead”—Edward’s latest work, The Recession Business Blueprint, serves as a strategic guide for modern entrepreneurship. His bibliography also includes Mastering Blender Python API and The Algorithmic Serpent.

Beyond the page, Edward produces open-source tool review videos and provides practical resources for the “build it yourself” movement.

📚 Explore His Books – Visit the Book Shop to grab your copies today.

💼 Need Support? – Learn more about Services and the ways to benefit from his expertise.

🔨 Build it Yourself – Download Free Plans for Backyard Structures, Small Living, and Woodworking.