How FrankenPHP Can Replace Nginx + PHP‑FPM for Faster Laravel Development

This guide walks through setting up FrankenPHP on Ubuntu, integrating it with Laravel and Octane, configuring Caddy, and benchmarking performance against traditional Nginx + PHP‑FPM, showing significant speed improvements.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
How FrankenPHP Can Replace Nginx + PHP‑FPM for Faster Laravel Development

Environment Preparation

Use Ubuntu 20.04.6 LTS with PHP 8.4.7, Nginx 1.24.0, Laravel 12.20.0, and FrankenPHP v1.8.0 (PHP 8.4.10, Caddy v2.10.0).

# Install FrankenPHP
curl https://frankenphp.dev/install.sh | sh
mv frankenphp /usr/local/bin/
# Serve the public/ directory
frankenphp php-server -r public/
# Run a CLI script
frankenphp php-cli script.php

Or use Docker:

# Serve the public/ directory
docker run -v $PWD:/app/public -p 443:443/tcp -p 443:443/udp dunglas/frankenphp
# Run a CLI script
docker run -v $PWD:/app dunglas/frankenphp php script.php

Laravel Installation and Octane Integration

composer global require laravel/installer
laravel new franken-demo
composer require laravel/octane
php artisan octane:install

During Octane installation, select FrankenPHP as the server driver.

Start the application:

/usr/bin/php8.4 artisan octane:start --server=frankenphp --host=0.0.0.0 --port=8008

FrankenPHP Quick Start

Check the version: /usr/local/bin/frankenphp version Start a web server with a single command (default directory is the current one): /usr/local/bin/frankenphp php-server Or specify a directory:

/usr/local/bin/frankenphp php-server -r ./public/

Run a PHP script directly:

/usr/local/bin/frankenphp php-cli ./public/info.php

Configuration for Laravel Projects

Create a Caddyfile in the Laravel root:

{
    frankenphp
    # Disable default ports to avoid conflict with local Nginx
    auto_https off
    http_port 8880
    https_port 8443
}

http://franken.demo:8006 {
    # Set the webroot to the public/ directory
    root public/
    encode zstd br gzip
    php_server {
        try_files {path} index.php
    }
}

Start FrankenPHP from the project root:

/usr/local/bin/frankenphp run

Performance Benchmarking

Traditional Nginx + PHP‑FPM test (1000 requests, 20 concurrency): ab -n 1000 -c 20 http://franken.demo/hello Result: ~100 requests/sec, 199 ms average latency.

FrankenPHP classic mode (no memory resident):

/usr/local/bin/frankenphp run
ab -n 1000 -c 20 http://franken.demo:8006/hello

Result: ~116 requests/sec, 172 ms average latency.

FrankenPHP worker mode with Laravel Octane:

/usr/bin/php8.4 artisan octane:start --server=frankenphp --host=0.0.0.0 --port=8008
ab -n 1000 -c 20 http://franken.demo:8008/hello

Result: ~209 requests/sec, 96 ms average latency.

The benchmarks clearly show that FrankenPHP, especially when combined with Laravel Octane, delivers a substantial performance boost over the classic Nginx + PHP‑FPM stack.

Conclusion

FrankenPHP simplifies PHP deployment by merging PHP, Caddy, and a high‑performance server into a single binary, reducing configuration complexity and improving request handling speed. For Laravel developers, integrating FrankenPHP via Octane offers a compelling path to faster local development and testing.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerLaravelphp-fpmOctaneCaddyFrankenPHP
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.