Run WordPress with FrankenPHP to enjoy a modern, high-performance stack with automatic HTTPS, HTTP/3, and Zstandard compression.
frankenphp php-server
http://localhost/wp-admin/ and follow the installation instructionsFor a production-ready setup, prefer using frankenphp run with a Caddyfile like this one:
example.com
php_server
encode zstd br gzip
log
To use the hot reload feature with WordPress, enable Mercure and add the hot_reload sub-directive to the php_server directive in your Caddyfile:
localhost
mercure {
anonymous
}
php_server {
hot_reload
}
Then, add the code needed to load the JavaScript libraries in the functions.php file of your WordPress theme:
function hot_reload() {
?>
<?php if (isset($_SERVER['FRANKENPHP_HOT_RELOAD'])): ?>
<meta name="frankenphp-hot-reload:url" content="<?=$_SERVER['FRANKENPHP_HOT_RELOAD']?>">
<script src="https://cdn.jsdelivr.net/npm/idiomorph"></script>
<script src="https://cdn.jsdelivr.net/npm/frankenphp-hot-reload/+esm" type="module"></script>
<?php endif ?>
<?php
}
add_action('wp_head', 'hot_reload');
Finally, run frankenphp run from the WordPress root directory.