Skip to content

Hot reload for plain PHP files #2247

@blackjyn

Description

@blackjyn

https://frankenphp.dev/docs/hot-reload/
By default, FrankenPHP will watch all files in the current working directory matching this glob pattern: ./**/*.{css,env,gif,htm,html,jpg,jpeg,js,mjs,php,png,svg,twig,webp,xml,yaml,yml}

however , I tried to do HMR on plain PHP files but doesnt work on changes.

can someone please share their Caddyfile config so I can do HMR on plain PHP files without injecting these:

<head>
<?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 ?>
</head>

my env:

  • FrankenPHP 1.12.0 PHP 8.5.3 Caddy v2.11.2
  • tested on Franken Windows native dist
  • tested on Franken Windows WSL dist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions