php:frankenphp

FrankenPHP - the modern PHP app server

$ curl https://frankenphp.dev/install.sh | sh

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4747  100  4747    0     0  11656      0 --:--:-- --:--:-- --:--:-- 11634
📦 Detected dnf. Installing FrankenPHP from RPM repository...
❗ Enter your password to grant sudo powers for package installation
リポジトリの更新を読み込み中:
リポジトリを読み込みました。
 https://rpm.henderkes.com/static-php-1-0.noarch.rpm                            100% |  28.3 KiB/s |   6.6 KiB |  00m00s
Package                                Arch       Version                                 Repository                Size
Installing:
 static-php                            noarch     1-0                                     @commandline         167.0   B

Transaction Summary:
 Installing:         1 package

パッケージサイズ 7 KiB 、ダウンロードサイズ 0 B 。
完了後、167 B のサイズが利用されます(インストール 167 B、削除 0 B)。
トランザクションを実行中
[1/3] パッケージ ファイルを検証                                     100% | 250.0   B/s |   1.0   B |  00m00s
[2/3] トランザクションの準備                                         100% |   1.0   B/s |   1.0   B |  00m01s
[3/3] インストール中 static-php-0:1-0.noarch                             100% | 247.0   B/s | 436.0   B |  00m02s
Warning: skipped OpenPGP checks for 1 package from repository: @commandline
完了しました!
リポジトリの更新を読み込み中:
リポジトリを読み込みました。
Nothing to do.
リポジトリの更新を読み込み中:
リポジトリを読み込みました。
Package                                 Arch       Version                                 Repository               Size
Installing:
 frankenphp                             x86_64     1.10.1_84-1                             static-php           53.7 MiB
Installing dependencies:
 php-zts-cli                            x86_64     8.4.15-1                                static-php           30.5 MiB
 php-zts-embed                          x86_64     8.4.15-1                                static-php           29.8 MiB

Transaction Summary:
 Installing:         3 packages

パッケージサイズ 31 MiB 、ダウンロードサイズ 31 MiB 。
完了後、114 MiB のサイズが利用されます(インストール 114 MiB、削除 0 B)。
[1/3] php-zts-cli-0:8.4.15-1.x86_64                                             100% | 124.3 KiB/s |   9.1 MiB |  01m15s
[2/3] frankenphp-0:1.10.1_84-1.x86_64                                           100% | 140.0 KiB/s |  12.7 MiB |  01m33s
[3/3] php-zts-embed-0:8.4.15-1.x86_64                                           100% |  94.0 KiB/s |   9.0 MiB |  01m38s
------------------------------------------------------------------------------------------------------------------------
[3/3] Total                                                                     100% | 321.5 KiB/s |  30.9 MiB |  01m38s
[1/4] https://key.henderkes.com/static-php.asc             ???% [<=>               ] |   0.0   B/s |   0.0   B |  00m00s
[1/4] https://key.henderkes.com/static-php.asc             ???% [<=>               ] |   0.0   B/s |   0.0   B |  00m00s
[1/4] https://key.henderkes.com/static-php.asc             ???% [<=>               ] |   0.0   B/s |   0.0   B |  00m00s
[1/4] https://key.henderkes.com/static-php.asc             ???% [<=>               ] |   0.0   B/s |   0.0   B |  00m00s
[1/4] https://key.henderkes.com/static-php.asc             ???% [ <=>              ] |   0.0   B/s |   0.0   B |  00m01s
[1/4] https://key.henderkes.com/static-php.asc             ???% [ <=>              ] |   0.0   B/s |   0.0   B |  00m01s
[1/4] https://key.henderkes.com/static-php.asc             ???% [  <=>             ] |   0.0   B/s |   0.0   B |  00m01s
[1/4] https://key.henderkes.com/static-php.asc              81% [===============   ] |   1.0   B/s |   1.3 KiB |  05m04s
[1/4] https://key.henderkes.com/static-php.asc                                  100% | 936.0   B/s |   1.6 KiB |  00m02s
------------------------------------------------------------------------------------------------------------------------
[4/4] Total                                                                     100% | 321.5 KiB/s |  30.9 MiB |  01m38s
OpenPGP キー 0x1A78797B をインポート中:
 UserID: "Static PHP repository <deb@static-php.dev>"
 識別子: 91531BFD00422E93810EC964EE324C271A78797B
 提供元: https://key.henderkes.com/static-php.asc
キーが正常にインポートされました。
[1/5] パッケージ ファイルを検証                                     100% |   7.0   B/s |   3.0   B |  00m00s
[2/5] トランザクションの準備                                         100% |   1.0   B/s |   3.0   B |  00m02s
[3/5] インストール中 php-zts-cli-0:8.4.15-1.x86_64                       100% |  16.0 MiB/s |  30.5 MiB |  00m02s
[4/5] インストール中 php-zts-embed-0:8.4.15-1.x86_64                     100% |  10.0 MiB/s |  29.8 MiB |  00m03s
[5/5] インストール中 frankenphp-0:1.10.1_84-1.x86_64                     100% | 347.1 KiB/s |  53.7 MiB |  02m38s
>>> %post scriptlet を実行中: frankenphp-0:1.10.1_84-1.x86_64                                                           
>>> %post scriptlet を実行完了: frankenphp-0:1.10.1_84-1.x86_64                                                         
>>> scriptlet 出力:                                                                                                     
>>> Port udp/80 already defined, modifying instead                                                                      
>>> Port udp/443 already defined, modifying instead                                                                     
>>> Error: requesting CA info: performing request: Get "http://localhost:2019/pki/ca/local": dial tcp [::1]:2019: connec
>>> {"level":"info","ts":1764934020.977941,"msg":"maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined"}                 
>>> {"level":"info","ts":1764934020.978333,"msg":"GOMEMLIMIT is updated","package":"github.com/KimMachineGun/automemlimi
>>> {"level":"info","ts":1764934020.9784248,"msg":"using config from file","file":"/dev/null"}                          
>>> {"level":"info","ts":1764934020.9787912,"msg":"shutting down apps, then terminating","signal":"SIGTERM"}            
>>> {"level":"warn","ts":1764934020.978819,"msg":"exiting; byeee!! 👋","signal":"SIGTERM"}                              
>>> {"level":"info","ts":1764934020.9806883,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","
>>> {"level":"info","ts":1764934020.980747,"msg":"serving initial configuration"}                                       
>>> {"level":"info","ts":1764934020.9808176,"logger":"admin","msg":"stopped previous server","address":"localhost:2019"}
>>> {"level":"info","ts":1764934020.980829,"msg":"shutdown complete","signal":"SIGTERM","exit_code":0}                  
>>>                                                                                                                     
完了しました!

🥳 FrankenPHP installed to /usr/bin/frankenphp successfully.
❗ The systemd service uses the Caddyfile in /etc/frankenphp/Caddyfile
❗ Your php.ini is found in /etc/php-zts/php.ini

⭐ If you like FrankenPHP, please give it a star on GitHub: https://github.com/php/frankenphp

caddyserver/sublimetext: Caddyfile syntax highlighting for Sublime Text 3
Caddyfile Syntax Highlighting for Sublime Text 3 を bat に追加😉

$ mkdir -p "$(bat --config-dir)/syntaxes"
$ curl -o "$(bat --config-dir)/syntaxes/Caddyfile.sublime-syntax" \
https://raw.githubusercontent.com/caddyserver/sublimetext/refs/heads/master/Caddyfile.sublime-syntax

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2175  100  2175    0     0   4242      0 --:--:-- --:--:-- --:--:--  4256

$ bat -p $(bat --config-dir)/syntaxes/Caddyfile.sublime-syntax
$ bat cache --build

No themes were found in '/home/tomoyan/.config/bat/themes', using the default set
Writing theme set to /home/tomoyan/.cache/bat/themes.bin ... okay
Writing syntax set to /home/tomoyan/.cache/bat/syntaxes.bin ... okay
Writing metadata to folder /home/tomoyan/.cache/bat ... okay

$ bat --list-languages | grep Caddyfile

Caddyfile:Caddyfile

2024/03/18 01:44 · ともやん

公式: install:caddy [DokuWiki]

$ bat -p Caddyfile

# ホスト設定(localhostでテスト)
localhost {
    encode zstd br gzip  # 圧縮有効(軽量化)
    root * sites/tomoyan.net/dokuwiki/  # DokuWikiのルートをここに

    #Remember to comment the below forbidden block out when you're installing, and uncomment it when done.
    @forbidden path /data/* /conf/* /bin/* /inc/* /install.php
    handle @forbidden {
        respond * 403
    }
    #End of the forbidden block
 
    try_files {path} {path}/index.html
 
    route {
        handle_path /_media/* {
            rewrite * /lib/exe/fetch.php?media={path}&{query}    
        }
        handle_path /_detail/* {
            rewrite * /lib/exe/detail.php?media={path}&{query}
        }        
        handle /_export/* {
            @export path_regexp export ^/_export/([^/]+)/(.*)
            rewrite @export /doku.php?do=export_{re.export.1}&{query}&id={re.export.2}
        }
        handle / {
            rewrite * /doku.php?{query}
        }
        try_files {path} /doku.php?id={path}&{query}
    }

    @static {
        file
        path *.avif *.css *.eot *.gif *.gz *.ico *.jpg *.jpeg *.js *.otf *.pdf *.png *.svg *.ttf *.webp *.woff *.woff2
    }
    header @static Cache-Control "max-age=31536000,public,immutable"

    php_server
}

$ frankenphp run --config Caddyfile

2025/12/06 19:55:13.213	INFO	maxprocs: Leaving GOMAXPROCS=4: CPU quota undefined
2025/12/06 19:55:13.213	INFO	GOMEMLIMIT is updated	{"package": "github.com/KimMachineGun/automemlimit/memlimit", "GOMEMLIMIT": 14979468902, "previous": 9223372036854775807}
2025/12/06 19:55:13.213	INFO	using config from file	{"file": "Caddyfile"}
2025/12/06 19:55:13.216	INFO	adapted config to JSON	{"adapter": "caddyfile"}
2025/12/06 19:55:13.216	WARN	Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies	{"adapter": "caddyfile", "file": "Caddyfile", "line": 3}
2025/12/06 19:55:13.219	INFO	admin	admin endpoint started	{"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2025/12/06 19:55:13.220	INFO	http.auto_https	server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS	{"server_name": "srv0", "https_port": 443}
2025/12/06 19:55:13.220	INFO	http.auto_https	enabling automatic HTTP->HTTPS redirects	{"server_name": "srv0"}
2025/12/06 19:55:13.220	INFO	tls.cache.maintenance	started background certificate maintenance	{"cache": "0xc000300f80"}
2025/12/06 19:55:13.222	INFO	pki.ca.local	root certificate is already trusted by system	{"path": "storage:pki/authorities/local/root.crt"}
2025/12/06 19:55:13.247	INFO	frankenphp	FrankenPHP started 🐘	{"php_version": "8.4.15", "num_threads": 8, "max_threads": 8}
2025/12/06 19:55:13.248	WARN	http	HTTP/2 skipped because it requires TLS	{"network": "tcp", "addr": ":80"}
2025/12/06 19:55:13.248	WARN	http	HTTP/3 skipped because it requires TLS	{"network": "tcp", "addr": ":80"}
2025/12/06 19:55:13.248	INFO	http.log	server running	{"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2025/12/06 19:55:13.248	INFO	http	enabling HTTP/3 listener	{"addr": ":443"}
2025/12/06 19:55:13.248	INFO	failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
2025/12/06 19:55:13.248	INFO	http.log	server running	{"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2025/12/06 19:55:13.248	INFO	http	enabling automatic TLS certificate management	{"domains": ["localhost"]}
2025/12/06 19:55:13.249	WARN	tls	stapling OCSP	{"identifiers": ["localhost"]}
2025/12/06 19:55:13.249	INFO	autosaved config (load with --resume flag)	{"file": "/home/tomoyan/.config/caddy/autosave.json"}
2025/12/06 19:55:13.249	INFO	serving initial configuration
2025/12/06 19:55:13.302	INFO	tls	storage cleaning happened too recently; skipping for now	{"storage": "FileStorage:/home/tomoyan/.local/share/caddy", "instance": "34cec023-b5ff-4514-b9f4-dd2472ae27c6", "try_again": "2025/12/07 19:55:13.302", "try_again_in": 86399.999998904}
2025/12/06 19:55:13.302	INFO	tls	finished cleaning storage units

  • php/frankenphp.txt
  • 最終更新: 2025/12/08 15:30
  • by ともやん