php / php/frankenphp

Embedded App: do not extract sources

Open
#2,308 12 comments 2 reactions 2 assignees View on GitHub

@dunglas is already working on this.

Since Mar 26, 2026.

enhancement
Dominant language
Go
Stars
11.3k
Forks
488
Avg merge
4d 10h
Merged PRs (30d)
11

Description

Describe your feature request

Is your feature request related to a problem? Please describe.
The extraction to /tmp/frankenphp_... brings a few issues with it.

  • /tmp must be writable.
  • systemd ProtectTmp can lead to unexpected paths
  • startup extracts the tar, can be slow
  • old files linger in /tmp until restart of the machine
  • source code is human readable without any reverse engineering

Describe the solution you'd like
Embedded filesystem inside the binary, rather than extracting the tares?

  • possibly encrypted? not a goal to truly make it "secure", but not immediately showing the source code is a plus

Describe your approach

  • create named virtual filesystem in go
  • redirect caddy to use that vfs for e.g. file_server and matchers
  • overwrite php file handlers to redirect to the vfs
  • work around possible opcache issues (?)
  • find a good solution for folders that need write access (e.g. symfony cache)?
  • embed a database...? not sure how this could be possible, but who knows. otherwise create a proof of concept using sqlite.

I'll work on this slowly over the next weeks. Don't expect anything immediately. I think @dunglas mentioned that something like this was planned as a potential commercial offering, so if you don't want me to pick it up, just let me know now before I start.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.