FrankenPHP is a revolutionary PHP application server built on top of Caddy and Go. It dramatically improves performance, simplifies configuration, and provides modern features that traditional PHP-FPM can't match.
What Is FrankenPHP?
FrankenPHP is a modern PHP app server that combines:
- Caddy Web Server: Modern, Go-based web server
- PHP Interpreter: Built directly into the server
- Worker Mode: Long-running PHP processes (like Node.js)
- Classic Mode: Drop-in PHP-FPM replacement
Why It's Revolutionary
Traditional PHP dies after each request. FrankenPHP's worker mode keeps your application alive, eliminating the overhead of bootstrapping on every request.
FrankenPHP vs PHP-FPM
| Feature | PHP-FPM | FrankenPHP |
|---|---|---|
| Request Handling | New process per request | Persistent worker processes |
| Bootstrap Time | Every request | Once (worker mode) |
| Memory Management | Complex pool tuning | Simple configuration |
| HTTP/3 Support | Requires Nginx | Built-in |
| Automatic HTTPS | Requires setup | Built-in via Caddy |
| Early Hints | Not available | Native support |
| Configuration | Complex | Simple |
| Binary | Multiple components | Single binary |
Performance Benefits
Classic Mode (PHP-FPM Replacement)
- Typically 10-20% faster than PHP-FPM
- Simpler configuration
- Modern HTTP features
- Same application code
Worker Mode (Long-Running)
- Up to 10-50x faster for some applications
- No bootstrap overhead per request
- Persistent database connections
- Ideal for Laravel applications
My FrankenPHP Setup Service
What I Provide
Server Configuration
- FrankenPHP binary installation
- Systemd service setup
- Auto-restart configuration
- Log management
- Resource limit tuning
Nginx Integration
- Reverse proxy configuration
- Load balancing setup
- SSL/TLS passthrough
- Health check configuration
Application Preparation
- Laravel Octane integration (worker mode)
- Configuration optimization
- Cache and session handling
- Queue worker setup
Installation Options
Classic Mode Setup
Drop-in replacement for PHP-FPM:
- Same application code works
- No code changes required
- Immediate performance gains
- Safe for any PHP application
# Example Classic Mode service
frankenphp php-server --listen 127.0.0.1:9000 --root /var/www/app/public
Worker Mode Setup
Maximum performance for Laravel:
- Requires Laravel Octane
- Persistent application state
- Database connection pooling
- Dramatic speed improvements
# Example Worker Mode with Laravel Octane
php artisan octane:frankenphp --workers=4 --max-requests=500
Ideal Use Cases
Laravel Applications ✅
FrankenPHP + Laravel Octane is a perfect match:
- Laravel's service container stays initialized
- Routes are cached once
- Config is loaded once
- Database connections persist
WordPress Sites ✅
Classic mode improves WordPress performance:
- No code changes needed
- Works with all plugins
- Simple migration from PHP-FPM
- Measurable speed improvements
High-Traffic APIs ✅
Worker mode excels for APIs:
- Minimal latency
- Maximum throughput
- Efficient resource usage
- Cost-effective scaling
Microservices ✅
Single binary deployment:
- Container-friendly
- Small image size
- Predictable resource usage
- Health check endpoints
My Setup Process
Phase 1: Assessment
Understanding your environment:
- Current server configuration
- PHP version and extensions required
- Application framework and version
- Traffic patterns and requirements
Phase 2: Preparation
Getting ready for installation:
- Server access and requirements
- Backup of current configuration
- Staging environment testing
- Rollback plan
Phase 3: Installation
Basic Setup:
- Download FrankenPHP binary
- Configure system service
- Set up Nginx reverse proxy
- Test and verify
Laravel Octane Setup:
- Install Laravel Octane package
- Configure Octane for FrankenPHP
- Set up worker processes
- Configure Supervisor/Systemd
Phase 4: Optimization
Fine-tuning for your workload:
- Worker count optimization
- Memory limit tuning
- Request limit configuration
- Monitoring setup
Phase 5: Monitoring & Handover
Ensuring long-term success:
- Performance baseline
- Monitoring configuration
- Documentation
- Team training
Build Types Explained
Static Build
Everything bundled in one binary:
- Zero dependencies
- Run anywhere (Alpine, Debian, Ubuntu, etc.)
- Perfect for Docker
- No system library issues
Dynamic Build (Glibc)
Uses system libraries:
- Familiar behavior
- System-patched libraries
- Easier extension loading
- Traditional approach
What's Included
Basic FrankenPHP Setup
Classic mode installation:
- FrankenPHP binary installation
- Systemd service configuration
- Basic Nginx reverse proxy
- Testing and verification
- Documentation
Advanced FrankenPHP Setup
Worker mode with full optimization:
- Everything in Basic
- Laravel Octane configuration
- Worker tuning
- Supervisor/process management
- Monitoring integration
- Load testing
- Performance report
Expected Performance Gains
| Application Type | Classic Mode | Worker Mode |
|---|---|---|
| Laravel App | +15-25% | +200-500% |
| WordPress | +10-20% | N/A |
| Raw PHP API | +10-15% | +300-1000% |
| Heavy Bootstrap | +20-30% | +500-2000% |
Results vary based on application and server configuration
Free Tool: FrankenPHP Classic Setup
I've created an open-source installer to automate the basic setup:
Features:
- Auto-detects architecture
- Generates systemd services
- Creates Nginx configurations
- Provides CLI wrappers
Get it:
git clone https://github.com/iperamuna/frankenphp-classic-setup.git
cd frankenphp-classic-setup
sudo ./setup.sh
For production setups with optimization and worker mode, use my professional service.
Ready to Supercharge Your PHP?
Let's upgrade your PHP infrastructure with FrankenPHP and see dramatic performance improvements.
Connect with me:
- GitHub: @iperamuna
- LinkedIn: Indunil Peramuna
- WhatsApp: +94 77 767 1771
- Telegram: @iperamuna