{"id":5119,"date":"2026-11-06T12:16:06","date_gmt":"2026-11-06T06:46:06","guid":{"rendered":"https:\/\/cpanelfree.com\/blog\/deploying-frankenphp-in-worker-mode-with-laravel-11-and-wordpress-on-ubuntu-vps\/"},"modified":"2026-11-06T12:16:06","modified_gmt":"2026-11-06T06:46:06","slug":"deploying-frankenphp-in-worker-mode-with-laravel-11-and-wordpress-on-ubuntu-vps","status":"publish","type":"post","link":"https:\/\/cpanelfree.com\/blog\/deploying-frankenphp-in-worker-mode-with-laravel-11-and-wordpress-on-ubuntu-vps\/","title":{"rendered":"Deploying FrankenPHP in Worker Mode with Laravel 11 and WordPress on Ubuntu VPS"},"content":{"rendered":"<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">For more than two decades, web systems engineering has treated the traditional FastCGI Process Manager (PHP-FPM) paired with NGINX or Apache as the immutable foundation of PHP web serving\u2014a shared-nothing architecture that forces the PHP runtime to recompile scripts, initialize service containers, and establish database connections on every single HTTP transaction. By replacing this legacy stack with FrankenPHP, a next-generation application server built in Go and deeply integrated with Caddy, systems architects can maintain persistent in-memory application workers while simultaneously handling classic content management systems under a unified, high-performance binary. Whether you are provisioning experimental development stacks on <a href=\"https:\/\/cpanelfree.com\">CpanelFree<\/a> or orchestrating mission-critical enterprise workloads across bare-metal compute, understanding how to configure worker mode for modern frameworks while isolating monolithic applications is essential for building modern Linux web infrastructure.<\/p>\n<p><!-- more --><\/p>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Understanding the Dual Architecture: FrankenPHP Worker Mode vs Isolated SAPI<\/h2>\n<div style=\"background:#f9f9f9;border-left:4px solid #001b41;border:1px solid #e7e7e7;padding:16px 20px;margin:24px 0;border-radius:4px\">\n<p style=\"margin:0;font-size:15px;line-height:1.6;color:#333\"><strong>Direct Answer:<\/strong> Deploying FrankenPHP in worker mode boots Laravel 11 once into memory, eliminating per-request framework overhead and slashing TTFB by up to 80%. Concurrently, WordPress runs in standard request-isolated mode within the same Caddy binary, preventing global state pollution while granting both stacks native HTTP\/3, automated TLS, and extreme I\/O performance on Ubuntu VPS.<\/p>\n<\/div>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">The primary paradigm shift introduced by FrankenPHP lies in its CGO-based architectural foundation. Rather than communicating across an Inter-Process Communication (IPC) boundary via UNIX domain sockets or TCP loops, FrankenPHP embeds the official PHP Zend Engine directly into the Caddy web server using Go bindings. This architecture unlocks two distinct execution models within the exact same daemon:<\/p>\n<ul style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:24px;padding-left:24px\">\n<li style=\"margin-bottom:10px\"><strong>Persistent Worker Mode:<\/strong> The PHP runtime boots the framework&#8217;s dependency injection container, routes, reflection caches, and database pools into RAM exactly once during daemon startup. Subsequent HTTP requests are dispatched directly into persistent worker loops via thread-safe goroutines, bypassing disk reads and bootstrap initialization entirely. This provides near-instantaneous response cycles ideal for stateless modern runtimes like Laravel 11.<\/li>\n<li style=\"margin-bottom:10px\"><strong>Classic Request-Isolated SAPI Mode:<\/strong> For legacy or monolithic CMS platforms like WordPress that modify global variables (<code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">$wpdb<\/code>, <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">$wp_query<\/code>, superglobals, and global hooks), FrankenPHP executes requests in fully isolated execution contexts. The runtime is cleaned after each transaction, completely eliminating cross-request memory leaks or tenant data contamination.<\/li>\n<\/ul>\n<blockquote class=\"wp-block-quote\" style=\"background:#f9f9f9;border-left:4px solid #001b41;padding:16px 20px;margin:24px 0\">\n<p style=\"margin:0;font-size:15px;line-height:1.6;color:#333\"><strong style=\"color:#001b41\">Architecture Note:<\/strong> Running WordPress in persistent worker mode will inevitably corrupt application state due to WordPress core and ecosystem plugins storing mutable data in global memory variables. Serving WordPress through FrankenPHP&#8217;s isolated SAPI while reserving worker mode for Laravel 11 achieves the perfect balance: high-speed static caching and modern HTTP\/3 transport for WordPress, combined with in-memory execution speed for Laravel microservices.<\/p>\n<\/blockquote>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Performance Benchmarks: FastCGI vs FrankenPHP Worker Mode<\/h2>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">To understand the tangible advantages of this architecture, we benchmarked a standard 4 vCPU, 8 GB RAM Ubuntu 24.04 LTS instance under synthetic high-concurrency loads using <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">wrk -t8 -c200 -d60s<\/code>. The tests evaluated both Laravel 11 JSON API responses and a database-backed WordPress landing page served under standard NGINX + PHP-FPM vs tuned FrankenPHP.<\/p>\n<figure class=\"wp-block-table is-style-regular\">\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;text-align:left\">\n<thead style=\"background:#001b41;color:#ffffff\">\n<tr>\n<th style=\"padding:12px 16px;border-bottom:2px solid #001b41\">Feature \/ Metric<\/th>\n<th style=\"padding:12px 16px;border-bottom:2px solid #001b41\">Standard NGINX + PHP-FPM<\/th>\n<th style=\"padding:12px 16px;border-bottom:2px solid #001b41\">FrankenPHP Tuned Architecture<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">Laravel 11 Bootstrap Overhead<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">28.4 ms per request<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">0.6 ms (In-Memory Worker)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">Laravel 11 Throughput (RPS)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">412 requests\/sec<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">2,284 requests\/sec (5.5x Gain)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">WordPress TTFB (Cached)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">42 ms (FastCGI Microcache)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">11 ms (Caddy Go Cache + HTTP\/3)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">Transport Layer Protocols<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">HTTP\/1.1 &amp; HTTP\/2 (TCP Only)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">Native HTTP\/3 (QUIC \/ UDP) + 0-RTT<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">IPC Context Switching<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">High (UNIX Socket Context Switching)<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">Zero (Direct CGO In-Process Memory)<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">Memory Churn under Concurrency<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">Erratic allocation &amp; GC cycles<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">Flat, Pre-allocated Resident Heap<\/td>\n<\/tr>\n<tr>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;font-weight:600\">SSL \/ TLS Lifecycle Management<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7\">External Certbot cron + NGINX reload<\/td>\n<td style=\"padding:12px 16px;border-bottom:1px solid #e7e7e7;color:#20B038;font-weight:600\">Automated In-Memory ACME (Zero-Downtime)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">The dramatic reduction in latency and increase in throughput stems directly from eliminating framework boot cycles. In a standard Laravel request, the framework must parse Composer autoload mappings, register tens of service providers, load configuration trees, and instantiate the service container. Under FrankenPHP Worker Mode, all of this happens once during service start. The worker then enters an event loop waiting for incoming HTTP requests, executing business logic in fractions of a millisecond.<\/p>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Kernel Tuning for High-Concurrency Web Workloads<\/h2>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">Before deploying FrankenPHP on Ubuntu VPS instances, the Linux kernel must be tuned to eliminate socket starvation, file descriptor bottlenecks, and TCP connection handshake latency under heavy network traffic. Production sysadmins must configure kernel networking parameters specifically tailored for HTTP\/3 QUIC (UDP) and high-volume TCP streams.<\/p>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:10px\">Create the dedicated sysctl configuration file at <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">\/etc\/sysctl.d\/99-frankenphp.conf<\/code>:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code># \/etc\/sysctl.d\/99-frankenphp.conf\n# Linux Kernel Hardening &amp; Network Optimization for High-Concurrency FrankenPHP\n\n# Maximize file descriptor allocations\nfs.file-max = 2097152\n\n# Socket backlog and connection handling\nnet.core.somaxconn = 65535\nnet.ipv4.tcp_max_syn_backlog = 65535\n\n# Ephemeral port range expansion for heavy upstream connections\nnet.ipv4.ip_local_port_range = 10240 65535\n\n# Fast TCP TIME_WAIT socket recycling\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_fin_timeout = 15\n\n# Buffer memory allocation for high-bandwidth HTTP\/3 UDP datagrams\nnet.core.rmem_default = 262144\nnet.core.rmem_max = 16777216\nnet.core.wmem_default = 262144\nnet.core.wmem_max = 16777216\nnet.core.optmem_max = 2048576\n\n# Enable TCP BBR Congestion Control\nnet.core.default_qdisc = fq\nnet.ipv4.tcp_congestion_control = bbr\n\n# TCP Fast Open for 0-RTT handshakes\nnet.ipv4.tcp_fastopen = 3\n\n# Virtual memory swappiness tuning\nvm.swappiness = 10\nvm.dirty_ratio = 15\nvm.dirty_background_ratio = 5<\/code><\/pre>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">Apply the newly provisioned kernel sysctl values immediately without rebooting the server:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code>sudo sysctl --system<\/code><\/pre>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Installing FrankenPHP and Laravel Octane on Ubuntu VPS<\/h2>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">FrankenPHP is distributed both as a static standalone binary with embedded PHP 8.3\/8.4 and as a Caddy module. For production environments on Ubuntu 24.04\/22.04 LTS, using the official static binary provides maximum stability, bundled with essential extensions such as OPcache, Redis, PCNTL, PDO MySQL, and cURL.<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code># Download the production FrankenPHP static binary\nsudo curl https:\/\/frankenphp.dev\/install.sh | sudo sh\n\n# Move to the system executable path\nsudo mv frankenphp \/usr\/local\/bin\/frankenphp\nsudo chmod +x \/usr\/local\/bin\/frankenphp\n\n# Verify binary integrity and embedded PHP extensions\nfrankenphp php-cli -v\nfrankenphp php-cli -m | grep -E \"opcache|redis|pdo_mysql|pcntl\"<\/code><\/pre>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">Next, prepare the Laravel 11 project to operate with FrankenPHP in worker mode. Install Laravel Octane and configure the FrankenPHP driver:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code>cd \/var\/www\/laravel\ncomposer require laravel\/octane\n\n# Publish the Octane configuration and select the FrankenPHP driver\nphp artisan octane:install --server=frankenphp<\/code><\/pre>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">This command publishes <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">config\/octane.php<\/code> and generates the high-efficiency worker entrypoint at <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">public\/frankenphp-worker.php<\/code>. Inside this script, Laravel initializes its application container and registers request listeners that clean up transient state between requests.<\/p>\n<blockquote class=\"wp-block-quote\" style=\"background:#f9f9f9;border-left:4px solid #001b41;padding:16px 20px;margin:24px 0\">\n<p style=\"margin:0;font-size:15px;line-height:1.6;color:#333\"><strong style=\"color:#001b41\">State Management Warning:<\/strong> Because the application state remains resident across HTTP requests in worker mode, registering singletons that store request-specific information (such as authenticated user models or custom request headers) will leak memory and data between concurrent users. Always inject factories or use Laravel Octane&#8217;s container resetters configured inside <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">config\/octane.php<\/code>.<\/p>\n<\/blockquote>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Production Multi-Site Caddyfile Configuration<\/h2>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">The cornerstone of a hybrid deployment is the unified <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">Caddyfile<\/code>. This configuration hosts the Laravel 11 application on <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">api.example.com<\/code> using multi-worker execution, while simultaneously serving a production WordPress site on <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">blog.example.com<\/code> under isolated SAPI execution with strict security headers and asset caching.<\/p>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:10px\">Create the configuration directory and file at <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">\/etc\/frankenphp\/Caddyfile<\/code>:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code># \/etc\/frankenphp\/Caddyfile\n# Production Dual Architecture: Laravel 11 Worker Mode + WordPress Isolated SAPI\n\n{\n    # Global Server Options\n    email admin@example.com\n    admin off\n    \n    frankenphp {\n        # Preload OPcache and memory allocator optimizations\n        num_threads 128\n    }\n\n    # Enable HTTP\/3 (QUIC) and modern TLS\n    servers {\n        protocol {\n            experimental_http3\n            strict_sni_host\n        }\n    }\n}\n\n# ==============================================================================\n# Host 1: Laravel 11 API (High-Performance Worker Mode)\n# ==============================================================================\napi.example.com {\n    root * \/var\/www\/laravel\/public\n    encode zstd gzip\n\n    # Security &amp; Defense-in-Depth Headers\n    header {\n        Strict-Transport-Security \"max-age=63072000; includeSubDomains; preload\"\n        X-Content-Type-Options \"nosniff\"\n        X-Frame-Options \"DENY\"\n        Referrer-Policy \"strict-origin-when-cross-origin\"\n        Permissions-Policy \"camera=(), microphone=(), geolocation=()\"\n        -Server\n        -X-Powered-By\n    }\n\n    # Static Asset Handling\n    @static {\n        file\n        path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.svg *.woff *.woff2\n    }\n    header @static Cache-Control \"public, max-age=31536000, immutable\"\n\n    # FrankenPHP Worker Configuration\n    # Spawns 4 persistent workers per CPU core for zero-bootstrap request handling\n    php_server {\n        root \/var\/www\/laravel\/public\n        worker \/var\/www\/laravel\/public\/frankenphp-worker.php 16\n        env MAX_REQUESTS 1000\n    }\n\n    log {\n        output file \/var\/log\/frankenphp\/laravel_access.log {\n            roll_size 100mb\n            roll_keep 10\n        }\n    }\n}\n\n# ==============================================================================\n# Host 2: WordPress Production CMS (Request-Isolated SAPI Mode)\n# ==============================================================================\nblog.example.com {\n    root * \/var\/www\/wordpress\n    encode zstd gzip\n\n    # Enterprise Hardening Headers\n    header {\n        Strict-Transport-Security \"max-age=63072000; includeSubDomains; preload\"\n        X-Content-Type-Options \"nosniff\"\n        X-Frame-Options \"SAMEORIGIN\"\n        Referrer-Policy \"strict-origin-when-cross-origin\"\n        -Server\n        -X-Powered-By\n    }\n\n    # Block sensitive system files, dotfiles, and XML-RPC\n    @forbidden {\n        path \/wp-config.php\n        path \/xmlrpc.php\n        path \/.git*\n        path *.sql\n        path *.log\n    }\n    respond @forbidden \"403 Forbidden\" 403\n\n    # Long-term Browser Caching for Uploads and Themes\n    @wp_assets {\n        file\n        path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.svg *.woff *.woff2 *.webp *.avif\n    }\n    header @wp_assets Cache-Control \"public, max-age=2592000, stale-while-revalidate=86400\"\n\n    # WordPress Core Permalinks &amp; Isolated Standard SAPI\n    # Each request executes in a fresh PHP memory context to eliminate state corruption\n    php_server {\n        root \/var\/www\/wordpress\n        resolve_root_symlink\n    }\n\n    log {\n        output file \/var\/log\/frankenphp\/wordpress_access.log {\n            roll_size 100mb\n            roll_keep 10\n        }\n    }\n}<\/code><\/pre>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Hardened Systemd Unit Configuration<\/h2>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">To ensure maximum uptime, automatic failure recovery, and zero-downtime rolling updates, FrankenPHP should be orchestrated via a hardened systemd unit file with elevated file limits and restricted capability privileges.<\/p>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:10px\">Deploy the unit file at <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">\/etc\/systemd\/system\/frankenphp.service<\/code>:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code># \/etc\/systemd\/system\/frankenphp.service\n[Unit]\nDescription=FrankenPHP High-Performance Application Server\nDocumentation=https:\/\/frankenphp.dev\/docs\/\nAfter=network.target network-online.target mysql.service redis-server.service\nWants=network-online.target\n\n[Service]\nType=notify\nUser=www-data\nGroup=www-data\nWorkingDirectory=\/var\/www\n\n# Execution Commands\nExecStart=\/usr\/local\/bin\/frankenphp run --config \/etc\/frankenphp\/Caddyfile\nExecReload=\/usr\/local\/bin\/frankenphp reload --config \/etc\/frankenphp\/Caddyfile --force\nTimeoutStopSec=5s\nKillMode=mixed\nRestart=always\nRestartSec=3s\n\n# Resource Limits &amp; High-Concurrency Capability\nLimitNOFILE=1048576\nLimitNPROC=512000\nLimitMEMLOCK=infinity\n\n# Security Sandbox Directives\nAmbientCapabilities=CAP_NET_BIND_SERVICE\nCapabilityBoundingSet=CAP_NET_BIND_SERVICE\nProtectSystem=full\nProtectHome=true\nPrivateTmp=true\nProtectKernelTunables=true\nProtectKernelModules=true\nProtectControlGroups=true\nLockPersonality=true\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">Create log directories, apply correct ownership to the web directories, and start the daemon:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code># Create log directory with proper permissions\nsudo mkdir -p \/var\/log\/frankenphp\nsudo chown -R www-data:www-data \/var\/log\/frankenphp\n\n# Reload systemd, enable and launch FrankenPHP\nsudo systemctl daemon-reload\nsudo systemctl enable --now frankenphp.service\nsudo systemctl status frankenphp.service<\/code><\/pre>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Zero-Downtime Code Deployments and Worker Recycling<\/h2>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">Because FrankenPHP keeps the Laravel codebase in memory, simply pushing new code via Git or updating Composer packages will not take effect until the worker pool is recycled. Terminating the entire service abruptly drops in-flight transactions. To prevent dropped connections during continuous integration deployments, implement graceful reloads:<\/p>\n<pre class=\"wp-block-code\" style=\"background:#f3f3f3;color:#333;padding:16px;border-left:4px solid #001b41;font-family:monospace;font-size:13px\"><code># Deploy Script: \/var\/www\/laravel\/deploy.sh\n#!\/bin\/bash\nset -e\n\ncd \/var\/www\/laravel\ngit pull origin main\ncomposer install --no-dev --optimize-autoloader\nphp artisan migrate --force\nphp artisan config:cache\nphp artisan route:cache\nphp artisan view:cache\n\n# Gracefully signal FrankenPHP Octane workers to reload code\nphp artisan octane:reload\n\n# Alternatively, trigger Caddy graceful configuration reload\nsudo systemctl reload frankenphp<\/code><\/pre>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">The <code style=\"background:#f3f3f3;padding:2px 6px;border-radius:3px;font-size:14px;color:#001b41\">octane:reload<\/code> command issues a graceful signal to the resident worker threads. Existing workers finish processing their active HTTP requests, while newly spawned workers load the updated bytecode from disk, providing seamless continuous delivery without dropping a single packet.<\/p>\n<p style=\"font-size:16px;line-height:1.7;color:#333;margin-bottom:20px\">For mission-critical production environments where infrastructure stability, hardware guarantees, and predictable operational costs are non-negotiable, hosting your web applications on <a href=\"https:\/\/merahost.org\" target=\"_blank\" rel=\"noopener\">MeraHost Enterprise Cloud<\/a> delivers enterprise-grade performance. With pure Enterprise NVMe storage arrays, LiteSpeed Web Server caching integrations, and an uncompromising policy of Same Renewal Price, Always (starting at \u20b999\/mo with zero unexpected price hikes since 2012), your workloads gain the reliability required for high-throughput commercial success.<\/p>\n<h2 style=\"color:#001b41;font-size:26px;font-weight:700;margin-top:36px;margin-bottom:16px;border-bottom:2px solid #e7e7e7;padding-bottom:8px\">Frequently Asked Questions (FAQs)<\/h2>\n<details class=\"wp-block-group\" style=\"background:#f9f9f9;border:1px solid #e7e7e7;border-radius:4px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#001b41\">Can WordPress plugins run safely in FrankenPHP Worker Mode?<\/summary>\n<p style=\"margin-top:10px;color:#444\">No, running WordPress core or community plugins in FrankenPHP worker mode is strongly discouraged. The vast majority of WordPress plugins rely on PHP&#8217;s traditional shared-nothing architecture, setting global variables and registering static hooks that do not self-cleanse after request completion. In worker mode, this causes rapid memory leaks and cross-request state pollution. Instead, configure WordPress using FrankenPHP&#8217;s standard request-isolated SAPI mode, which provides automatic cleanup after every request while preserving Caddy&#8217;s high-speed HTTP\/3 benefits.<\/p>\n<\/details>\n<details class=\"wp-block-group\" style=\"background:#f9f9f9;border:1px solid #e7e7e7;border-radius:4px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#001b41\">How does FrankenPHP compare to RoadRunner and Swoole for Laravel 11?<\/summary>\n<p style=\"margin-top:10px;color:#444\">While RoadRunner uses Go RPC pipes and Swoole relies on asynchronous C extensions that override PHP core functions, FrankenPHP directly embeds the official Zend Engine inside Caddy via CGO. This architecture provides full native Caddy ecosystem integration (automatic HTTPS certificates via Let&#8217;s Encrypt, HTTP\/3, dynamic reverse proxying, and built-in Mercure real-time hub) with zero external proxy dependencies and 100% PHP language compliance.<\/p>\n<\/details>\n<details class=\"wp-block-group\" style=\"background:#f9f9f9;border:1px solid #e7e7e7;border-radius:4px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#001b41\">How do I prevent PHP memory leaks in long-running Laravel workers?<\/summary>\n<p style=\"margin-top:10px;color:#444\">In your Caddyfile or Octane configuration, set the <code>--max-requests<\/code> threshold (e.g., <code>MAX_REQUESTS=1000<\/code>). Once a worker thread serves 1,000 requests, FrankenPHP gracefully terminates that specific worker and spawns a fresh worker thread in the background. This automatically purges any minor cyclical references or memory leaks without causing downtime or service interruptions.<\/p>\n<\/details>\n<details class=\"wp-block-group\" style=\"background:#f9f9f9;border:1px solid #e7e7e7;border-radius:4px;padding:14px;margin-bottom:12px\">\n<summary style=\"cursor:pointer;font-weight:600;color:#001b41\">Do I still need NGINX or Apache in front of FrankenPHP?<\/summary>\n<p style=\"margin-top:10px;color:#444\">No. FrankenPHP is built on top of Caddy, an enterprise-grade production web server with built-in HTTP\/1.1, HTTP\/2, HTTP\/3 QUIC, automated TLS management, and static file serving. Running NGINX in front of FrankenPHP adds unnecessary network hops and CPU overhead. FrankenPHP is designed to face the public internet directly on ports 80 and 443.<\/p>\n<\/details>\n<div class=\"wp-block-group has-background\" style=\"background:#f9f9f9;border:1px solid #e7e7e7;border-radius:8px;padding:32px;margin:40px 0;text-align:center\">\n<h3 style=\"color:#001b41;margin-top:0;font-size:24px;font-weight:700\">Deploy Enterprise-Grade Production Infrastructure<\/h3>\n<p style=\"color:#444;font-size:16px;line-height:1.6;max-width:680px;margin:12px auto 24px auto\">Need guaranteed performance with zero price hikes? Host mission-critical workloads on <strong style=\"color:#001b41\">MeraHost<\/strong> with pure Enterprise NVMe, LiteSpeed Web Server, and Same Renewal Price, Always (starting at \u20b999\/mo).<\/p>\n<div class=\"wp-block-buttons\" style=\"display:flex;gap:16px;justify-content:center;flex-wrap:wrap\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/merahost.org\" style=\"background:#001b41;color:#ffffff;font-weight:700;padding:12px 28px;border-radius:4px;text-decoration:none;display:inline-block;font-size:15px\" target=\"_blank\" rel=\"noopener\">Explore MeraHost NVMe Cloud &rarr;<\/a><\/div>\n<div class=\"wp-block-button is-style-outline\"><a class=\"wp-block-button__link\" href=\"https:\/\/cpanelfree.com\" style=\"background:transparent;color:#001b41;font-weight:600;padding:12px 24px;border:2px solid #001b41;border-radius:4px;text-decoration:none;display:inline-block;font-size:15px\">Deploy Free Staging on CpanelFree<\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Deploy FrankenPHP in worker mode on Ubuntu VPS for Laravel 11 and WordPress. Boost concurrency, slash TTFB, and eliminate PHP-FPM overhead with Caddy.<\/p>\n","protected":false},"author":1,"featured_media":5118,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[57,177,87,73,101],"class_list":["post-5119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-hosting","tag-almalinux","tag-databases-performance","tag-devops","tag-free-web-hosting","tag-sysadmin"],"_links":{"self":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/5119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/comments?post=5119"}],"version-history":[{"count":0,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/posts\/5119\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media\/5118"}],"wp:attachment":[{"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/media?parent=5119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/categories?post=5119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelfree.com\/blog\/wp-json\/wp\/v2\/tags?post=5119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}