FrankenPHP aarch64 doesn't work on (unrooted) Android (Termux) - lock error

1. The problem I’m having:

FrankenPHP doesn’t start, logfile ends with “Error Cannot create lock - Permission denied (13)”.

I didn’t try the same thing with rooted phone, so in reality I don’t know if it helps or not.
However unrooted Android is well known for having many restrictions regarding file permissions etc.

Where is this required lock file located? Is it possible to change its location (if it is file-based lock at all, I have no idea…)?

BTW - caddy installed from termux packages (ie. via “pkg install caddy”) works fine, more or less. But it doesn’t support PHP out of the box, so I’d prefer FrankenPHP.

2. Error messages and/or full log output:

~/public_html $ ls
Caddyfile  index.php
~/public_html $ cat Caddyfile
{
        http_port 8081
        frankenphp
        order php_server before file_server
}

localhost:8081 {
        php_server
}
~/public_html $ cat index.php
<?php
echo 'Hello, World!';
~/public_html $ ../bin/frankenphp-linux-aarch64 run
2024/04/06 12:10:28.310 WARN    failed to set GOMAXPROCS        {"error": "open /dev/cpuctl/cpu.cfs_quota_us: no such file or directory"}
2024/04/06 12:10:28.310 INFO    using adjacent Caddyfile
2024/04/06 12:10:28.312 INFO    admin   admin endpoint started  {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2024/04/06 12:10:28.312 WARN    http.auto_httpsserver is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 8081}
2024/04/06 12:10:28.312 INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0x400040b500"}
2024/04/06 12:10:28.313 INFO    FrankenPHP started 🐘   {"php_version": "8.3.4"}
2024/04/06 12:10:28.313 INFO    http.log       server running   {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2024/04/06 12:10:28.315 INFO    autosaved config (load with --resume flag)      {"file": "/data/data/com.termux/files/home/.config/caddy/autosave.json"}
2024/04/06 12:10:28.315 INFO    serving initial configuration
2024/04/06 12:10:28.317 WARN    tls     storage cleaning happened too recently; skipping for now{"storage": "FileStorage:/data/data/com.termux/files/home/.local/share/caddy", "instance": "2c94cbde-5bbe-4421-974b-a46035eaf794", "try_again": "2024/04/07 12:10:28.317", "try_again_in": 86399.999998958}
2024/04/06 12:10:28.317 INFO    tls     finished cleaning storage units
Sat Apr  6 12:10:28 2024 (521425426816): Error Cannot create lock - Permission denied (13)

3. Caddy version:

~/public_html $ ../bin/frankenphp-linux-aarch64 version
2024/04/06 12:11:41.965 WARN    failed to set GOMAXPROCS        {"error": "open /dev/cpuctl/cpu.cfs_quota_us: no such file or directory"}
FrankenPHP v1.1.2 PHP 8.3.4 Caddy v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=

4. How I installed and ran Caddy:

I downloaded the newest FrankenPHP release for aarch64 Linux from

then moved it to ~/bin and chmod u+x it

a. System environment:

Termux (from F-Droid) on unrooted Android 10.
So it is Linux kernel 4.x.x on aarch64

b. Command:

frankenphp-linux-aarch64 run

See also above.

c. Service/unit/compose file:

d. My complete Caddy config:

{
        http_port 8081
        frankenphp
        order php_server before file_server
}

localhost:8081 {
        php_server
}

5. Links to relevant resources:

(See point 4.)

You should open an issue on the FrankenPHP repo. This seems like an issue with FrankenPHP specifically, not really with Caddy.