Skip to main content

What is PHP on Zerops?

Zerops provides a fully managed PHP runtime environment with integrated web servers (Apache or Nginx), automatic scaling, and zero-config deployment. Build and deploy your PHP applications with enterprise-grade performance and reliability.
PHP is a popular general-purpose scripting language especially suited to web development. Learn more about PHP →

Key Features

Dual Web Server Support

Choose between PHP+Apache or PHP+Nginx configurations optimized for your use case

Automatic Scaling

Horizontal and vertical auto-scaling based on actual resource usage

PHP-FPM Optimization

Configurable FastCGI Process Manager for optimal performance

Composer Integration

Built-in Composer support for seamless dependency management

Supported Versions

Zerops supports multiple PHP versions:
  • PHP 8.3 (Latest)
  • PHP 8.2
  • PHP 8.1
  • PHP 8.0
  • PHP 7.4
You can change the major version at any time through the zerops.yaml configuration.

Web Server Options

PHP + Apache

Ideal for traditional PHP applications with .htaccess support:
services:
  - hostname: app
    type: [email protected]

PHP + Nginx

Optimized for high-performance applications:
services:
  - hostname: app
    type: [email protected]

Quick Example

Deploy a simple PHP application in minutes:
project:
  name: my-php-app
services:
  - hostname: app
    type: [email protected]
    minContainers: 1
    maxContainers: 3
    buildFromGit: https://github.com/zeropsio/recipe-php-hello-world@main
    enableSubdomainAccess: true

Runtime Environment

The PHP runtime environment includes:
  • Alpine Linux (default) or Ubuntu
  • Selected PHP version
  • Composer for dependency management
  • Git and wget utilities
  • Zerops CLI tools
  • Configurable PHP-FPM

PHP-FPM Configuration

Customize PHP-FPM process management:

Dynamic Mode (Default)

run:
  envVariables:
    PHP_FPM_PM: dynamic
    PHP_FPM_PM_MAX_CHILDREN: 20
    PHP_FPM_PM_START_SERVERS: 2
    PHP_FPM_PM_MIN_SPARE_SERVERS: 1
    PHP_FPM_PM_MAX_SPARE_SERVERS: 3

OnDemand Mode

Optimal for lower traffic applications:
run:
  envVariables:
    PHP_FPM_PM: ondemand
    PHP_FPM_PM_MAX_CHILDREN: 20
    PHP_FPM_PM_PROCESS_IDLE_TIMEOUT: 60s

PHP.ini Customization

Override PHP configuration through environment variables:
run:
  envVariables:
    PHP_INI_post_max_size: 10M
    PHP_INI_upload_max_filesize: 10M
    PHP_INI_memory_limit: 256M

Use Cases

Perfect for Laravel apps with optimized Composer workflows and PHP-FPM configurations.
Run WordPress with Apache for .htaccess support and automatic scaling.
Deploy Symfony applications with custom build processes and caching.
Build RESTful APIs with Nginx for maximum performance.

Common Configuration

Custom Document Root

Set a custom web server root:
run:
  documentRoot: public

Custom Web Server Config

Provide custom Nginx or Apache configuration:
run:
  siteConfigPath: config/nginx.conf

Install System Packages

Add required dependencies:
run:
  os: ubuntu
  prepareCommands:
    - sudo apt-get install -y imagemagick
    - sudo apt-get install -y ffmpeg

Next Steps

Quickstart Guide

Deploy your first PHP application

Example Projects

Explore PHP examples on GitHub

Build docs developers (and LLMs) love