cphalcon Documentation

High performance, full-stack PHP framework delivered as a C extension.

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy cphalcon on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name cphalcon --restart always mariadb:10.6
Configured Services & Ports
โš™๏ธ cphalcon-dev-8.1
image: build locally
โš™๏ธ cphalcon-dev-8.2
image: build locally
โš™๏ธ cphalcon-dev-8.3
image: build locally
โš™๏ธ cphalcon-dev-8.4
image: build locally
โš™๏ธ cphalcon-dev-8.5
image: build locally
โš™๏ธ cphalcon-bench-8.4
image: build locally
โš™๏ธ mariadb
image: mariadb:10.6
โš™๏ธ mysql
image: mysql:8.0
โš™๏ธ postgres
image: postgres:18-alpine
โš™๏ธ redis
image: redis:8-alpine
โš™๏ธ redis-node-0
image: docker.io/bitnamilegacy/redis-cluster:8.2
โš™๏ธ redis-node-1
image: docker.io/bitnamilegacy/redis-cluster:8.2
โš™๏ธ redis-node-2
image: docker.io/bitnamilegacy/redis-cluster:8.2
โš™๏ธ redis-node-3
image: docker.io/bitnamilegacy/redis-cluster:8.2
โš™๏ธ redis-node-4
image: docker.io/bitnamilegacy/redis-cluster:8.2
โš™๏ธ redis-node-5
image: docker.io/bitnamilegacy/redis-cluster:8.2
โš™๏ธ memcached
image: memcached:1.6-alpine
โš™๏ธ beanstalkd
image: schickling/beanstalkd:latest
docker-compose.yml
yaml (docker-compose.yml)
# For local development only.

name: ${PROJECT_PREFIX:-cphalcon}

services:
  cphalcon-dev-8.1:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-8.1
    hostname: ${PROJECT_PREFIX:-cphalcon}-dev-81
    build:
      dockerfile: resources/docker/develop/Dockerfile
      target: dev
      args:
        PHP_VERSION: 8.1
        UID: ${UID:-1000}
        GID: ${GID:-1000}
    working_dir: /srv
    volumes:
      - .:/srv
    extra_hosts:
      - "host.docker.internal:host-gateway"

  cphalcon-dev-8.2:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-8.2
    hostname: ${PROJECT_PREFIX:-cphalcon}-dev-82
    build:
      dockerfile: resources/docker/develop/Dockerfile
      target: dev
      args:
        PHP_VERSION: 8.2
        UID: ${UID:-1000}
        GID: ${GID:-1000}
    working_dir: /srv
    volumes:
      - .:/srv
    extra_hosts:
      - "host.docker.internal:host-gateway"

  cphalcon-dev-8.3:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-8.3
    hostname: ${PROJECT_PREFIX:-cphalcon}-dev-83
    build:
      dockerfile: resources/docker/develop/Dockerfile
      target: dev
      args:
        PHP_VERSION: 8.3
        UID: ${UID:-1000}
        GID: ${GID:-1000}
    working_dir: /srv
    volumes:
      - .:/srv
    extra_hosts:
      - "host.docker.internal:host-gateway"

  cphalcon-dev-8.4:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-8.4
    hostname: ${PROJECT_PREFIX:-cphalcon}-dev-84
    build:
      dockerfile: resources/docker/develop/Dockerfile
      target: dev
      args:
        PHP_VERSION: 8.4
        PHP_DIGEST: sha256:b0d7dff8f2d57155aebb5150dfcb5056a8c8d977aac3c2e21cfce32b8a4b004d
        UID: ${UID:-1000}
        GID: ${GID:-1000}
    working_dir: /srv
    volumes:
      - .:/srv
    extra_hosts:
      - "host.docker.internal:host-gateway"

  cphalcon-dev-8.5:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-8.5
    hostname: ${PROJECT_PREFIX:-cphalcon}-dev-85
    build:
      dockerfile: resources/docker/develop/Dockerfile
      target: dev
      args:
        PHP_VERSION: 8.5
        UID: ${UID:-1000}
        GID: ${GID:-1000}
    working_dir: /srv
    volumes:
      - .:/srv
    extra_hosts:
      - "host.docker.internal:host-gateway"

  cphalcon-bench-8.4:
    container_name: ${PROJECT_PREFIX:-cphalcon}-bench-8.4
    hostname: ${PROJECT_PREFIX:-cphalcon}-bench-84
    profiles:
      - bench
    build:
      dockerfile: resources/docker/develop/Dockerfile
      target: bench
      args:
        PHP_VERSION: 8.4
        PHP_DIGEST: sha256:b0d7dff8f2d57155aebb5150dfcb5056a8c8d977aac3c2e21cfce32b8a4b004d
        UID: ${UID:-1000}
        GID: ${GID:-1000}
    working_dir: /srv
    volumes:
      - .:/srv

  mariadb:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-mariadb
    image: mariadb:10.6
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_USER=phalcon
      - MYSQL_DATABASE=phalcon
      - MYSQL_PASSWORD=secret
    extra_hosts:
      - "host.docker.internal:host-gateway"

  mysql:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-mysql
    image: mysql:8.0
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_USER=phalcon
      - MYSQL_DATABASE=phalcon
      - MYSQL_PASSWORD=secret
    extra_hosts:
      - "host.docker.internal:host-gateway"

  postgres:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-postgres
    image: postgres:18-alpine
    environment:
      - POSTGRES_PASSWORD=secret
      - POSTGRES_USER=phalcon
      - POSTGRES_DB=phalcon
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis
    image: redis:8-alpine
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis-node-0:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis-node-0
    image: docker.io/bitnamilegacy/redis-cluster:8.2
    environment:
      - 'REDIS_PASSWORD=bitnami'
      - 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis-node-1:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis-node-1
    image: docker.io/bitnamilegacy/redis-cluster:8.2
    environment:
      - 'REDIS_PASSWORD=bitnami'
      - 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis-node-2:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis-node-2
    image: docker.io/bitnamilegacy/redis-cluster:8.2
    environment:
      - 'REDIS_PASSWORD=bitnami'
      - 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis-node-3:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis-node-3
    image: docker.io/bitnamilegacy/redis-cluster:8.2
    environment:
      - 'REDIS_PASSWORD=bitnami'
      - 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis-node-4:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis-node-4
    image: docker.io/bitnamilegacy/redis-cluster:8.2
    environment:
      - 'REDIS_PASSWORD=bitnami'
      - 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
    extra_hosts:
      - "host.docker.internal:host-gateway"

  redis-node-5:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-redis-node-5
    image: docker.io/bitnamilegacy/redis-cluster:8.2
    depends_on:
      - redis-node-0
      - redis-node-1
      - redis-node-2
      - redis-node-3
      - redis-node-4
    environment:
      - 'REDIS_PASSWORD=bitnami'
      - 'REDISCLI_AUTH=bitnami'
      - 'REDIS_CLUSTER_REPLICAS=1'
      - 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
      - 'REDIS_CLUSTER_CREATOR=yes'
    extra_hosts:
      - "host.docker.internal:host-gateway"

  memcached:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-memcached
    image: memcached:1.6-alpine
    extra_hosts:
      - "host.docker.internal:host-gateway"

  beanstalkd:
    container_name: ${PROJECT_PREFIX:-cphalcon}-dev-beanstalkd
    image: schickling/beanstalkd:latest
    extra_hosts:
      - "host.docker.internal:host-gateway"

1. Project Overview & Quickstart (phalcon/cphalcon)

Phalcon Framework

Latest Version
PHP Version
Total Downloads
License

Phalcon 5.x CI
Quality Gate (phalcon)
Coverage (phalcon)

Discord
Contributors
Phalcon Backers
OpenCollective Backers
OpenCollective Sponsors

5.0 Pull Requests
5.0 Issues

Phalcon is an open-source web framework delivered as a C extension for PHP, providing high performance and lower resource consumption.

A big thank you to our Backers; you rock!

Getting Started

Phalcon is written in Zephir/C with platform independence in mind.
As a result, Phalcon is available on Microsoft Windows, GNU/Linux, FreeBSD and macOS.
You can either download a binary package for the system of your choice or build it from source.

Installation

PIE is the modern PHP extension installer:

bash
pie install phalcon/cphalcon

Using PECL

[!IMPORTANT]
PECL has been deprecated, so users should switch to installing Phalcon with PIE. We will keep releasing on PECL until PECL is retired or v5.x reaches its end of life.

bash
pecl install phalcon

From source

For detailed installation instructions you can check our installation page in the docs.

Generating API Documentation

Generating new documentation files for docs repository can be done using the script in bin/generate-api-docs.php.
Steps:

  • Clone the phalcon repo
  • Checkout the tag you would like to generate docs for.
  • Run php bin/generate-api-docs.php
  • The generated *.md files will contain the documentation
  • For publishing to the Phalcon website this repo is used.

General

Support

Social Media

Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

License

Phalcon is open-source software licensed under the BSD 3-Clause License.

Copyright ยฉ 2011-present, Phalcon Team.

See the LICENSE.txt file for details. Additional licenses of packages that Phalcon uses, is inspired by, or has adapted are located in the 3rdparty/licenses directory.

2. Official Technical Reference & Guides (phalcon/docs)

Phalcon Framework - Documentation

You can find our documentation project in Crowdin here

Contributing

Phalcon is an open source PHP framework. This repository holds our documentation, one branch per version.

The repository contains all the languages that we have translations of our documentation for. The master language is English en and that is the only one that can be changed in this repository.

If you wish to contribute to our documentation you can do so as follows:

Changes to English documents

Submit a PR with your modifications only to the en/ folder. Since the English folder is the 'master' one, any changes to the files under the en/ folder will be propagated to the other languages.
API documentation can be generated from the Phalcon source files.

Translations

You can start translating documentation in a language other than English that you speak. You can do so by joining our project in Crowdin here

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]