PHP Web Framework Phalcon

Phalcon PHP Framework with MariaDB Using Podman
Phalcon PHP Framework with MariaDB Using Podman

Live stream set for 2025-07-26 at 14:00:00 Eastern

Ask questions in the live chat about any programming or lifestyle topic.

This livestream will be on YouTube or you can watch below.

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!

About Edward

Edward is a software engineer, web developer, and author dedicated to helping people achieve their personal and professional goals through actionable advice and real-world tools.

As the author of impactful books including Learning JavaScript, Learning Python, Learning PHP, Mastering Blender Python API, and fiction The Algorithmic Serpent, Edward writes with a focus on personal growth, entrepreneurship, and practical success strategies. His work is designed to guide, motivate, and empower.

In addition to writing, Edward offers professional "full-stack development," "database design," "1-on-1 tutoring," "consulting sessions,", tailored to help you take the next step. Whether you are launching a business, developing a brand, or leveling up your mindset, Edward will be there to support you.

Edward also offers online courses designed to deepen your learning and accelerate your progress. Explore the programming on languages like JavaScript, Python and PHP to find the perfect fit for your journey.

📚 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.
🎓 Ready to Learn? – Check out his Online Courses to turn your ideas into results.

Leave a Reply

Your email address will not be published. Required fields are marked *