<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ephpm on Luther Monson</title>
    <link>https://luth.io/tags/ephpm/</link>
    <description>Recent content in Ephpm on Luther Monson</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Thu, 15 Oct 2026 19:45:00 -0700</lastBuildDate>
    <atom:link href="https://luth.io/tags/ephpm/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fourth Place in Worker Mode, and Why It Wasn&#39;t PHP</title>
      <link>https://luth.io/blog/2026/10/ephpm-worker-mode-performance/</link>
      <pubDate>Thu, 15 Oct 2026 19:45:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/ephpm-worker-mode-performance/</guid>
      <description>&lt;p&gt;We added &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; to the&#xA;&lt;a href=&#34;https://github.com/Yii3-Benchmarks/app-api&#34;&gt;Yii3 runtime benchmark&lt;/a&gt;. It runs the same Yii3 API app on a bunch of PHP&#xA;runtimes and compares them. Our fork with the ePHPm runner is &lt;a href=&#34;https://github.com/ephpm/app-api&#34;&gt;ephpm/app-api&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Most of the results were good. ePHPm came first in classic mode and first on the database endpoint in both modes.&#xA;Classic mode is the PHP-FPM style, where every request starts fresh.&lt;/p&gt;&#xA;&lt;p&gt;Worker mode was the surprise. In worker mode the app boots once and stays in memory, like Octane or FrankenPHP&amp;rsquo;s&#xA;worker mode. We came fourth of ten at about 50.7k requests a second. Workerman (~65k) and Swoole (~62k) were ahead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Composer Without PHP: Embedding vivacity in ePHPm</title>
      <link>https://luth.io/blog/2026/10/composer-without-php-vivacity/</link>
      <pubDate>Wed, 14 Oct 2026 23:20:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/composer-without-php-vivacity/</guid>
      <description>&lt;p&gt;The pitch for &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; is one binary in place of php-fpm, nginx and Redis. There was&#xA;always a hole in it though. To deploy a PHP app you still need to run &lt;code&gt;composer install&lt;/code&gt;. That drags PHP and&#xA;&lt;code&gt;composer.phar&lt;/code&gt; back onto the box or into the container build, just for that one step. &lt;code&gt;ephpm composer install&lt;/code&gt; now&#xA;runs a pure-Rust, Composer-compatible installer called &lt;a href=&#34;https://github.com/Adelagric/vivacity&#34;&gt;vivacity&lt;/a&gt; inside the&#xA;ePHPm binary. One binary serves the app and installs its dependencies. On Windows that works with no PHP installed at&#xA;all. Getting it right took five upstream PRs and a fork. It also took a docs rewrite that took back claims we&amp;rsquo;d already&#xA;made. And I had to teach &lt;code&gt;ephpm&lt;/code&gt; to pretend to be &lt;code&gt;php&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Lock Is Only as Good as Its Release</title>
      <link>https://luth.io/blog/2026/10/a-lock-is-only-as-good-as-its-release/</link>
      <pubDate>Tue, 13 Oct 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/a-lock-is-only-as-good-as-its-release/</guid>
      <description>&lt;p&gt;Every &amp;ldquo;build a lock on Redis&amp;rdquo; tutorial spends its time on acquisition: &lt;code&gt;SET key value NX PX 30000&lt;/code&gt;, one winner, done. The&#xA;release gets one line, &lt;code&gt;DEL key&lt;/code&gt;. That line is where most of the lock bugs I&amp;rsquo;ve had in ePHPm lived. Over about three&#xA;months the same mistake showed up in three places. First the native session handler, then two of the Composer wrapper&#xA;packages, and finally the cluster. Each time it wore a slightly different costume.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Step Debugging a Worker That Never Ends</title>
      <link>https://luth.io/blog/2026/10/xdebug-worker-mode/</link>
      <pubDate>Mon, 12 Oct 2026 21:10:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/xdebug-worker-mode/</guid>
      <description>&lt;p&gt;Persistent workers are the big performance win in modern PHP. You boot Laravel or Symfony once, keep the container&#xA;in memory, and serve thousands of requests out of the same process. &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; has had&#xA;a worker mode for a while. Like most worker runtimes it had a quiet hole in it. You couldn&amp;rsquo;t step debug a request with&#xA;Xdebug. I wanted that fixed without patching Xdebug and without giving up the warm pool. The answer ended up being to&#xA;stop fighting the constraint and route around it. The debug lane is merged on main and coming in the upcoming v0.12.0&#xA;release.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WebSockets in ePHPm, From Zero to a Working Chat</title>
      <link>https://luth.io/blog/2026/10/ephpm-websockets-how-to/</link>
      <pubDate>Sun, 11 Oct 2026 17:30:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/ephpm-websockets-how-to/</guid>
      <description>&lt;p&gt;I covered the design of &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt;&amp;rsquo;s native WebSockets in a few paragraphs of the &lt;a href=&#34;https://luth.io/blog/2026/09/ephpm-smaller-angles/&#34;&gt;odds&#xA;and ends post&lt;/a&gt;. Rust owns the socket and PHP runs once per event. An idle&#xA;connection never costs you a PHP thread. That was the why. This post is the how. We&amp;rsquo;ll build a small chat app with&#xA;login, per-user push notifications from ordinary HTTP requests and a browser client. Then we&amp;rsquo;ll serve it over TLS.&#xA;Last come the limits, the sharp edges and how to debug it when the browser only tells you &lt;code&gt;1006&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>An Upstream PHP JIT Use-After-Free, and Why Our Default Flipped Twice</title>
      <link>https://luth.io/blog/2026/10/php-jit-use-after-free/</link>
      <pubDate>Thu, 01 Oct 2026 20:10:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/10/php-jit-use-after-free/</guid>
      <description>&lt;p&gt;In August, &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; turned PHP&amp;rsquo;s tracing JIT on by default in single-site serve mode.&#xA;Three days later it went back off on every platform, and it&amp;rsquo;s still off. The reason turned out to be a use-after-free&#xA;in PHP&amp;rsquo;s tracing JIT that has nothing to do with ePHPm. Stock &lt;code&gt;php -S&lt;/code&gt; with a stock Laravel skeleton dies on it in a&#xA;couple of requests. The fix is now released upstream. So this seemed like the right time to write up how we got there,&#xA;and what still has to happen before the default can flip again.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calling Rust From PHP Without a Socket, Part 2: Making Existing Code Use It</title>
      <link>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-2/</link>
      <pubDate>Mon, 21 Sep 2026 19:55:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-2/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-1/&#34;&gt;Part 1&lt;/a&gt; covered the plumbing. ePHPm registers&#xA;&lt;code&gt;ephpm_kv_*&lt;/code&gt; and &lt;code&gt;ephpm_db_*&lt;/code&gt; functions that call straight into Rust. A cache read through one costs about a tenth of a&#xA;microsecond instead of a loopback round trip. That&amp;rsquo;s nice and also useless on its own. Nobody is going to rewrite their&#xA;WordPress object cache or their Laravel cache store around a function called &lt;code&gt;ephpm_kv_set()&lt;/code&gt;. Applications talk to&#xA;existing APIs instead:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Redis through phpredis or Predis&lt;/li&gt;&#xA;&lt;li&gt;the cache through PSR-6/16 or &lt;code&gt;wp_cache_*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;the database through &lt;code&gt;wpdb&lt;/code&gt;, mysqli, Eloquent or DBAL&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So there&amp;rsquo;s a set of Composer packages in the &lt;a href=&#34;https://github.com/ephpm&#34;&gt;ephpm org&lt;/a&gt; whose whole job is to sit under those&#xA;APIs and route them to the native functions. This post covers what&amp;rsquo;s in them and the rule that decides when they switch&#xA;on. It also covers the bugs that only showed up once real applications ran on top.&lt;/p&gt;</description>
    </item>
    <item>
      <title>ePHPm Odds and Ends: OOM-Killed Links, Opcode Scanning, WebSockets and a 44 ms Stall</title>
      <link>https://luth.io/blog/2026/09/ephpm-smaller-angles/</link>
      <pubDate>Fri, 18 Sep 2026 20:05:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/ephpm-smaller-angles/</guid>
      <description>&lt;p&gt;Not every fix in &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; earns a full write-up. A few of the smaller ones have stuck&#xA;with me because the lesson in each was bigger than the diff. Here are four from this summer.&lt;/p&gt;&#xA;&lt;h3 id=&#34;a-release-build-the-oom-killer-kept-eating&#34;&gt;A release build the OOM killer kept eating&lt;/h3&gt;&#xA;&lt;p&gt;ePHPm statically links libphp, ICU and a pile of other C libraries into one Rust binary. It ships for four targets.&#xA;For the v0.4.2 performance release I set the release profile to &lt;code&gt;lto = &amp;quot;fat&amp;quot;&lt;/code&gt; with &lt;code&gt;codegen-units = 1&lt;/code&gt;&#xA;(&lt;a href=&#34;https://github.com/ephpm/ephpm/pull/171&#34;&gt;#171&lt;/a&gt;). Fat LTO pulls every crate&amp;rsquo;s LLVM IR into one module in one process&#xA;and optimizes it as a unit. One codegen unit removes the parallelism that would otherwise spread that memory out.&#xA;That&amp;rsquo;s one very large process at the final link.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Bugs Were Our Own Linker Wraps: Making a PHP Timeout Actually Time Out</title>
      <link>https://luth.io/blog/2026/09/php-timeout-linker-wraps/</link>
      <pubDate>Wed, 16 Sep 2026 19:35:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/php-timeout-linker-wraps/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;https://luth.io/blog/2026/09/php-stack-guard-segfault-containment/&#34;&gt;the stack guard post&lt;/a&gt; the villain was a &lt;code&gt;-Wl,--wrap&lt;/code&gt; linker&#xA;flag that turned off PHP&amp;rsquo;s C-stack overflow guard. It wasn&amp;rsquo;t the only one. Until August, &lt;code&gt;max_execution_time&lt;/code&gt; did&#xA;nothing in &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; on Linux, for the same reason. We had wrapped the function that arms&#xA;it to a no-op. A runaway script ran until the HTTP layer&amp;rsquo;s request timeout gave up on it and sent a 504. The PHP thread&#xA;kept burning CPU after that.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clustered SQLite in ePHPm, Part 3: CDC Over the Cluster Channel</title>
      <link>https://luth.io/blog/2026/09/clustered-sqlite-cdc-cluster-channel/</link>
      <pubDate>Tue, 15 Sep 2026 21:08:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/clustered-sqlite-cdc-cluster-channel/</guid>
      <description>&lt;p&gt;By the end of &lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/&#34;&gt;Part 2&lt;/a&gt; ePHPm v0.7.0 ran exactly one SQLite engine in&#xA;process. That was Turso, for single-node and clustered mode alike. The sidecar was gone. What I skipped over is how a&#xA;replica actually gets the primary&amp;rsquo;s writes, and what happens when the primary dies with data on it. That&amp;rsquo;s this post.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/&#34;&gt;Part 1: Replication by sidecar with sqld&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/&#34;&gt;Part 2: Adding Turso&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 3: CDC over the cluster channel (this post)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;cdc-from-the-engine-itself&#34;&gt;CDC from the engine itself&lt;/h3&gt;&#xA;&lt;p&gt;Turso has change data capture built in. Turn it on for a connection and every committed change lands in a &lt;code&gt;turso_cdc&lt;/code&gt;&#xA;table. Each row has a monotonically increasing &lt;code&gt;change_id&lt;/code&gt;, the table, the rowid, and before/after images of the record.&#xA;The primary tails that table and ships transaction batches. Replicas apply them. That&amp;rsquo;s the whole design. It landed as&#xA;an experimental path in &lt;a href=&#34;https://github.com/ephpm/ephpm/pull/186&#34;&gt;#186&lt;/a&gt; at the end of July. The tailer and applier live&#xA;in litewire (&lt;a href=&#34;https://github.com/ephpm/litewire/pull/10&#34;&gt;litewire#10&lt;/a&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calling Rust From PHP Without a Socket, Part 1: The Native Functions</title>
      <link>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-1/</link>
      <pubDate>Mon, 14 Sep 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/calling-rust-from-php-without-a-socket-part-1/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; is a single Rust binary that embeds PHP. It carries its own KV store and its own&#xA;SQLite-backed database in the same process. For a long time PHP code could only reach that KV store the same way it&#xA;reaches Redis. It opened a TCP socket to the RESP listener ePHPm runs on localhost, encoded a command and waited for the&#xA;reply. That works, and every PHP Redis client in existence already speaks it. But it is a strange thing to do when the&#xA;hash map you&amp;rsquo;re talking to lives a few pointers away in the same address space.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Every Way a Tenant Escaped: A Cross-Tenant Breakout Field Guide</title>
      <link>https://luth.io/blog/2026/09/cross-tenant-breakout-field-guide/</link>
      <pubDate>Sun, 13 Sep 2026 16:20:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/cross-tenant-breakout-field-guide/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; can serve a directory full of sites out of one process. Point &lt;code&gt;sites_dir&lt;/code&gt; at&#xA;a folder and every subdirectory is a virtual host. The Host header decides which one you get. That&amp;rsquo;s how the PR preview&#xA;environment runs. Every pull request gets a subdomain, and the code behind it is whatever somebody pushed. One process&#xA;holding many tenants means ePHPm enforces every per-tenant boundary itself, in-process. There&amp;rsquo;s no container wall&#xA;between site A and site B unless you add one.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Making ephpm php Byte-for-Byte Indistinguishable From php-cli</title>
      <link>https://luth.io/blog/2026/09/ephpm-php-cli-conformance/</link>
      <pubDate>Thu, 10 Sep 2026 20:25:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/ephpm-php-cli-conformance/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; embeds PHP into a single Rust binary. The obvious follow-up question from&#xA;anybody deploying it is &amp;ldquo;do I still need a &lt;code&gt;php&lt;/code&gt; on the box?&amp;rdquo; Composer, WP-CLI, artisan, PHPUnit and every build&#xA;script in the world call &lt;code&gt;php&lt;/code&gt;. If &lt;code&gt;ephpm php&lt;/code&gt; can stand in for it then the answer is no. The single binary really means&#xA;a single binary. &amp;ldquo;Mostly works&amp;rdquo; isn&amp;rsquo;t good enough for that though. These tools parse PHP&amp;rsquo;s output, check its exit codes&#xA;and re-invoke it. So the goal was simple to state: &lt;code&gt;ephpm php&lt;/code&gt; should be indistinguishable from php-cli.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Zero-Dependency Deployments - Single Binary for WordPress</title>
      <link>https://luth.io/blog/2026/09/single-binary-wordpress/</link>
      <pubDate>Tue, 08 Sep 2026 20:25:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/single-binary-wordpress/</guid>
      <description>&lt;p&gt;The standard way to run a WordPress site is four services:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;nginx for HTTP and TLS&lt;/li&gt;&#xA;&lt;li&gt;php-fpm to run PHP&lt;/li&gt;&#xA;&lt;li&gt;MySQL for data&lt;/li&gt;&#xA;&lt;li&gt;Redis, once the site gets slow enough that someone installs an object cache plugin&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;That&amp;rsquo;s four processes and four config files. There are three sockets between them and four things to upgrade. For a&#xA;big site that&amp;rsquo;s fine. For a brochure site or a staging copy it&amp;rsquo;s absurd. The same goes for a PR preview, a box at the&#xA;edge, or a CI job that needs a real WordPress to test a plugin against.&lt;/p&gt;</description>
    </item>
    <item>
      <title>P99 From 280 ms to 58 ms by Making the Queue Fair</title>
      <link>https://luth.io/blog/2026/09/php-dispatch-fair-queue-p99/</link>
      <pubDate>Mon, 07 Sep 2026 19:45:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/php-dispatch-fair-queue-p99/</guid>
      <description>&lt;p&gt;A third-party Laravel runtime comparison put &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt;&amp;rsquo;s worker mode at the top on&#xA;throughput. It was about 19% ahead of FrankenPHP on &lt;code&gt;/api/static&lt;/code&gt;. It was also at the bottom of the fast group on tail&#xA;latency, with a P99 of 157 ms against FrankenPHP&amp;rsquo;s 57 ms. Best throughput plus the fattest tail is a shape worth&#xA;chasing, because fast execution can&amp;rsquo;t produce it. Making requests faster lowers the mean &lt;em&gt;and&lt;/em&gt; the tail. Only waiting&#xA;can pull them apart. Specifically, unfair waiting.&lt;/p&gt;</description>
    </item>
    <item>
      <title>We Disabled PHP&#39;s Stack Guard Ourselves: Containing Segfaults in a Single-Process PHP Server</title>
      <link>https://luth.io/blog/2026/09/php-stack-guard-segfault-containment/</link>
      <pubDate>Sun, 06 Sep 2026 15:05:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/php-stack-guard-segfault-containment/</guid>
      <description>&lt;p&gt;php-fpm has a property nobody thinks about until they leave it. When a worker segfaults, you lose one request. The&#xA;master forks a new child and life goes on. &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; runs every tenant&amp;rsquo;s PHP as threads&#xA;inside one process. That&amp;rsquo;s where the memory and latency wins come from. It also means one tenant&amp;rsquo;s segfault takes down&#xA;every other tenant on the box.&lt;/p&gt;&#xA;&lt;p&gt;This is the story of closing that gap in four steps over about two weeks. The last step turned out to be a bug we&amp;rsquo;d&#xA;put there ourselves. It&amp;rsquo;s also the payoff for the thread pool work in&#xA;&lt;a href=&#34;https://luth.io/blog/2026/09/own-your-php-thread-pool/&#34;&gt;the previous post&lt;/a&gt;. Everything below that actually shipped depends on ePHPm&#xA;owning its own PHP threads.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stop Running PHP on tokio&#39;s spawn_blocking - Own Your Thread Pool</title>
      <link>https://luth.io/blog/2026/09/own-your-php-thread-pool/</link>
      <pubDate>Fri, 04 Sep 2026 20:30:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/own-your-php-thread-pool/</guid>
      <description>&lt;p&gt;For most of its life, &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; ran every PHP request on tokio&amp;rsquo;s &lt;code&gt;spawn_blocking&lt;/code&gt;&#xA;pool. It works. It passes tests and it serves benchmarks fine. It&amp;rsquo;s the first thing anybody reaches for when they need&#xA;to call blocking code from async Rust. It&amp;rsquo;s also quietly wrong for a language runtime. The problems only show up under&#xA;overload or after a crash. Over the last three weeks it got replaced with a pool of OS threads that ePHPm owns. That&#xA;pool shipped first behind a config flag, then as the default. As of v0.9.0 the &lt;code&gt;spawn_blocking&lt;/code&gt; engine is gone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clustered ACME in Production: Three Bugs That Took TLS Down</title>
      <link>https://luth.io/blog/2026/09/clustered-acme-three-bugs/</link>
      <pubDate>Wed, 02 Sep 2026 19:30:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/09/clustered-acme-three-bugs/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; gets its own certificates from Let&amp;rsquo;s Encrypt. In a cluster only one node should&#xA;be talking to the CA. The nodes elect an ACME leader over the shared KV store. The leader orders the cert, and everybody&#xA;else installs it from KV. That all had unit tests and had worked on single nodes for months. Then I tried to move&#xA;wildcard TLS termination for our preview environment off a separate proxy and onto the 3-node cluster itself. In about&#xA;two days it found three separate bugs that each took TLS down. None of them showed up in a unit test. All of them are&#xA;the kind of thing you only learn by putting the feature on real machines.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Middleware in PHP: Compiling It With elephc, Then Not Needing To</title>
      <link>https://luth.io/blog/2026/08/php-middleware-elephc/</link>
      <pubDate>Mon, 31 Aug 2026 20:50:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/php-middleware-elephc/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; middleware runs &lt;em&gt;before&lt;/em&gt; PHP. It&amp;rsquo;s a small versioned C ABI, loaded with&#xA;&lt;code&gt;dlopen&lt;/code&gt;, that gets to look at a request and reject it before PHP boots or the request body is read. That&amp;rsquo;s the&#xA;right shape for a gateway. It&amp;rsquo;s the wrong shape for most PHP shops, who want to write their middleware in PHP. This is&#xA;the story of compiling PHP into a native &lt;code&gt;.so&lt;/code&gt; to fit that ABI and finding exactly where it broke. Then I built the lane&#xA;that should have existed in the first place.&lt;/p&gt;</description>
    </item>
    <item>
      <title>OPcache on Windows: Two Silent Failures</title>
      <link>https://luth.io/blog/2026/08/opcache-on-windows-two-silent-failures/</link>
      <pubDate>Sat, 29 Aug 2026 16:45:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/opcache-on-windows-two-silent-failures/</guid>
      <description>&lt;p&gt;Windows is the platform where &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; gets the least traffic and the most surprises.&#xA;Last week closed out two OPcache bugs that only exist there. Both were quiet in their own way. One killed the server&#xA;at startup with nothing in our own logs. The other didn&amp;rsquo;t kill anything. It just ran PHP 8.3 with no opcode cache at&#xA;all. For three weeks after a fixed SDK was published, every check stayed green.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Per-Tenant Network Policy in One Process: ePHPm&#39;s eBPF Thread Tags</title>
      <link>https://luth.io/blog/2026/08/ephpm-ebpf-per-vhost-network-policy/</link>
      <pubDate>Fri, 28 Aug 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/ephpm-ebpf-per-vhost-network-policy/</guid>
      <description>&lt;p&gt;In multi-tenant mode &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; serves every site in &lt;code&gt;sites_dir&lt;/code&gt; from one process. Every&#xA;tenant&amp;rsquo;s PHP runs as the same OS user on the same pool of ZTS threads. A thread that just served &lt;code&gt;blog.example&lt;/code&gt; will&#xA;serve &lt;code&gt;shop.example&lt;/code&gt; a few milliseconds later. That&amp;rsquo;s the density win. It also means the kernel has no idea which&#xA;tenant is behind a given &lt;code&gt;connect()&lt;/code&gt;. As far as Linux is concerned it&amp;rsquo;s all &lt;code&gt;ephpm-web&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Most of the isolation work in ePHPm happens above the kernel. That covers &lt;code&gt;open_basedir&lt;/code&gt;, the function denylist,&#xA;per-site databases and KV keyspaces. Network is the one place where that isn&amp;rsquo;t enough. This week we brought eBPF in&#xA;to give the kernel a per-tenant identity. It went from a roadmap doc on Wednesday morning to merged that evening&#xA;(&lt;a href=&#34;https://github.com/ephpm/ephpm/pull/413&#34;&gt;#413&lt;/a&gt;, aimed at v0.8.1). v0.8.1 never got a release because its Linux&#xA;legs failed to link. v0.8.2 shipped with the BPF object silently stubbed out. v0.8.3 was the first release that&#xA;carried it. This post covers what it enforces and what it costs. It also covers what broke on the way out the door&#xA;and what it doesn&amp;rsquo;t do.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Security and Performance Hardening of a Rust Database Proxy</title>
      <link>https://luth.io/blog/2026/08/hardening-rust-database-proxy/</link>
      <pubDate>Thu, 27 Aug 2026 20:30:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/hardening-rust-database-proxy/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/litewire&#34;&gt;litewire&lt;/a&gt; is the piece of ePHPm that lets PHP apps talk MySQL to a SQLite file. I&#xA;wrote about &lt;a href=&#34;https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/&#34;&gt;how it works&lt;/a&gt; and about &lt;a href=&#34;https://luth.io/blog/2026/08/faking-mysql-quirks-wordpress/&#34;&gt;the MySQL quirks&#xA;WordPress depends on&lt;/a&gt;. This one is the less visible half of August:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an audit pass on litewire&lt;/li&gt;&#xA;&lt;li&gt;a multi-tenant mode that turned a database proxy into a security boundary&lt;/li&gt;&#xA;&lt;li&gt;a performance regression I shipped and then had to go find&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It&amp;rsquo;s written in Rust. Memory safety is supposed to be the part I don&amp;rsquo;t have to think about, and it mostly is. The&#xA;use-after-free in this story was in a dependency. The worst bug wasn&amp;rsquo;t a memory bug at all.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What Does One More WordPress Site Cost?</title>
      <link>https://luth.io/blog/2026/08/what-does-one-more-wordpress-site-cost/</link>
      <pubDate>Tue, 25 Aug 2026 20:20:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/what-does-one-more-wordpress-site-cost/</guid>
      <description>&lt;p&gt;ePHPm v0.7.0 shipped per-site multi-tenancy. Point &lt;code&gt;[server] sites_dir&lt;/code&gt; at a directory and every &lt;code&gt;Host&lt;/code&gt; maps to its own&#xA;docroot and its own Turso database file. One process serves all of them. The first question anybody asks about that is&#xA;&amp;ldquo;how many sites fit on a box?&amp;rdquo; The honest way to answer it is to turn the question around. What does &lt;strong&gt;one more&lt;/strong&gt; site&#xA;cost? If you know the marginal RAM, file descriptors, CPU and disk for a tenant, the box size falls out of arithmetic.&lt;/p&gt;</description>
    </item>
    <item>
      <title>What an Overloaded PHP Server Actually Returns</title>
      <link>https://luth.io/blog/2026/08/what-an-overloaded-php-server-actually-returns/</link>
      <pubDate>Mon, 24 Aug 2026 19:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/what-an-overloaded-php-server-actually-returns/</guid>
      <description>&lt;p&gt;Ask most people what their PHP server does when it&amp;rsquo;s overloaded and you&amp;rsquo;ll hear &amp;ldquo;it returns 503s.&amp;rdquo; Ask them how they&#xA;know and it usually comes down to a config setting they read about. I was in that camp for &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt;.&#xA;We had a &lt;code&gt;[server.limits] max_connections&lt;/code&gt; knob, and the docs said it returned 503 at the cap. Every benchmark we had&#xA;ever run reported zero errors under heavy load. Then I wrote a load generator that could produce overload. The honest&#xA;answer was that an overloaded ePHPm returned nothing at all.&lt;/p&gt;</description>
    </item>
    <item>
      <title>My Benchmark Was 4x Wrong Because of WSL</title>
      <link>https://luth.io/blog/2026/08/benchmark-4x-wrong-wsl-drvfs-cwd/</link>
      <pubDate>Thu, 20 Aug 2026 20:45:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/benchmark-4x-wrong-wsl-drvfs-cwd/</guid>
      <description>&lt;p&gt;I do most of my benchmarking on a Windows box in WSL2. It&amp;rsquo;s the machine on my desk with 32 threads and 62 GB of RAM.&#xA;Everybody who does that learns the first rule early: don&amp;rsquo;t put your data on &lt;code&gt;/mnt/c&lt;/code&gt;. DrvFs is the 9p-backed mount that&#xA;exposes the Windows drives inside WSL, and it&amp;rsquo;s slow for file-heavy work. So the databases, the docroot and the build&#xA;output all live on the WSL ext4 disk. My scaling harness for &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; even says so in&#xA;capital letters in its README.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clustered SQLite in ePHPm, Part 2: Adding Turso</title>
      <link>https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/</link>
      <pubDate>Wed, 19 Aug 2026 20:37:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/clustered-sqlite-adding-turso/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/&#34;&gt;Part 1&lt;/a&gt; ended with ePHPm running two SQLite engines. rusqlite ran&#xA;in-process for a single node, and an embedded sqld child process ran for a cluster. The sidecar fell off a cliff past&#xA;four concurrent writers. The best fix I could ship was a semaphore set to 1. This post is about replacing both engines&#xA;with one, and about how I decided that engine was ready.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/&#34;&gt;Part 1: Replication by sidecar with sqld&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Part 2: Adding Turso (this post)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://luth.io/blog/2026/09/clustered-sqlite-cdc-cluster-channel/&#34;&gt;Part 3: CDC over the cluster channel&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;the-thesis&#34;&gt;The thesis&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/tursodatabase/turso&#34;&gt;Turso Database&lt;/a&gt; is a rewrite of SQLite in Rust:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rolling Your Own KV Store Instead of Embedding Redis</title>
      <link>https://luth.io/blog/2026/08/rolling-your-own-kv-store/</link>
      <pubDate>Mon, 17 Aug 2026 20:44:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/rolling-your-own-kv-store/</guid>
      <description>&lt;p&gt;Every PHP deployment I&amp;rsquo;ve run eventually grew a Redis. Sessions, the WordPress object cache, Laravel&amp;rsquo;s cache and locks,&#xA;rate limiting. &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; is supposed to be one binary that replaces nginx + php-fpm +&#xA;Redis, so it needed a cache in the box. I didn&amp;rsquo;t want to write one. This post covers why I did anyway and how it&amp;rsquo;s&#xA;built. It also covers the bug that sat in its eviction code from March until last month. Then I compare it against a&#xA;stock Redis on the same machine with &lt;code&gt;redis-benchmark&lt;/code&gt; doing the talking.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Faking MySQL&#39;s Quirks Well Enough to Fool WordPress</title>
      <link>https://luth.io/blog/2026/08/faking-mysql-quirks-wordpress/</link>
      <pubDate>Sun, 16 Aug 2026 15:50:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/faking-mysql-quirks-wordpress/</guid>
      <description>&lt;p&gt;Last month I wrote about &lt;a href=&#34;https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/&#34;&gt;running SQLite behind a MySQL socket&lt;/a&gt;&#xA;with &lt;a href=&#34;https://github.com/ephpm/litewire&#34;&gt;litewire&lt;/a&gt;. I ended on &amp;ldquo;passing an install suite is not the same thing as&#xA;behaving like MySQL&amp;rdquo;. That turned out to be accurate. On August 10th a few things happened at once:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I put a real WordPress 7.0.3 site through a benchmark on ePHPm.&lt;/li&gt;&#xA;&lt;li&gt;I A/B tested the new in-process database bridge against the wire path.&lt;/li&gt;&#xA;&lt;li&gt;I started building &lt;a href=&#34;https://github.com/ephpm/db-wordpress&#34;&gt;ephpm/db-wordpress&lt;/a&gt;, a &lt;code&gt;wpdb&lt;/code&gt; drop-in that talks to the&#xA;database in-process instead of over a socket.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Between them they produced six litewire issues in about three hours. None of them broke the install. All of them made&#xA;WordPress quietly do the wrong thing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Requests That End Wrong: A 200 That Was Really a Crash</title>
      <link>https://luth.io/blog/2026/08/requests-that-end-wrong/</link>
      <pubDate>Thu, 13 Aug 2026 21:14:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/requests-that-end-wrong/</guid>
      <description>&lt;p&gt;The scariest response a server can send isn&amp;rsquo;t a 500. It&amp;rsquo;s a 200 that should have been a 500. A crash is loud. The pod&#xA;restarts, an alert fires, somebody looks. A truncated page with a success status code is quiet. Your CDN caches it and&#xA;the health check calls the box healthy. A client parses half a document as if it were the whole thing.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; embeds PHP inside a Rust server. So we own the part of PHP that php-fpm&#xA;normally owns: starting a request, running the script and ending it. Over the last couple of months I&amp;rsquo;ve fixed three&#xA;bugs that all live in that start-and-end code. None of them were in the SAPI I/O callbacks like &lt;code&gt;ub_write&lt;/code&gt; and&#xA;&lt;code&gt;read_post&lt;/code&gt;, where you&amp;rsquo;d expect to find embed bugs. They were in the Zend request lifecycle and in TSRM teardown.&#xA;That&amp;rsquo;s code you never touch when you run PHP behind php-fpm.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Database Connection Pooling with Smart Reset</title>
      <link>https://luth.io/blog/2026/08/db-connection-pooling-smart-reset/</link>
      <pubDate>Sun, 09 Aug 2026 16:25:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/db-connection-pooling-smart-reset/</guid>
      <description>&lt;p&gt;PHP&amp;rsquo;s share-nothing model is one of its best properties. It has one expensive side effect: a request can&amp;rsquo;t keep a&#xA;database connection for the next request. php-fpm gives you &lt;code&gt;PDO::ATTR_PERSISTENT&lt;/code&gt; and &lt;code&gt;mysqli&lt;/code&gt;&amp;rsquo;s &lt;code&gt;p:&lt;/code&gt; hosts. But&#xA;those are per-worker-process. PDO&amp;rsquo;s keep whatever session state the last request left behind. mysqli at least resets&#xA;the session with &lt;code&gt;COM_CHANGE_USER&lt;/code&gt; on reuse. And almost nobody turns them on. So in practice every PHP request does a&#xA;TCP connect, a MySQL handshake and an auth exchange. Then it maybe sends some &lt;code&gt;SET&lt;/code&gt;s, runs its queries and sends&#xA;&lt;code&gt;COM_QUIT&lt;/code&gt;. Multiply that by your request rate and MySQL spends a real share of its time authenticating clients it&#xA;just said goodbye to.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clustered SQLite in ePHPm, Part 1: Replication by Sidecar</title>
      <link>https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/</link>
      <pubDate>Sat, 08 Aug 2026 20:14:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/clustered-sqlite-sqld-sidecar/</guid>
      <description>&lt;p&gt;Most PHP sites I have run in the last twenty years did not need a MySQL server. They needed &lt;em&gt;a&lt;/em&gt; database, and MySQL was the&#xA;one every framework spoke. With &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; I have been trying to get rid of that server for&#xA;the common case. The piece that makes it possible is &lt;a href=&#34;https://github.com/ephpm/litewire&#34;&gt;litewire&lt;/a&gt;. PHP connects with&#xA;plain &lt;code&gt;pdo_mysql&lt;/code&gt;. litewire speaks the MySQL wire protocol, and the queries land in a SQLite file. WordPress and Laravel&#xA;don&amp;rsquo;t know the difference. No &lt;code&gt;mysqld&lt;/code&gt;, no child processes, just &lt;code&gt;ephpm&lt;/code&gt; and a &lt;code&gt;.db&lt;/code&gt; file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gossip-Based Clustering for PHP Apps</title>
      <link>https://luth.io/blog/2026/08/gossip-clustering-for-php/</link>
      <pubDate>Tue, 04 Aug 2026 20:52:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/08/gossip-clustering-for-php/</guid>
      <description>&lt;p&gt;Most PHP developers never touch clustering primitives. That&amp;rsquo;s by design. PHP is share-nothing. Each request starts&#xA;from zero, and anything shared lives somewhere else. Sessions go in Redis. Cache goes in Redis or Memcached. Locks go&#xA;in Redis. When you run two app servers, the &amp;ldquo;cluster&amp;rdquo; is really two stateless boxes pointed at the same Redis. That&#xA;works until Redis is the thing you&amp;rsquo;re trying not to run.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; has its own KV store in the same process as PHP. On one node that&amp;rsquo;s&#xA;straightforward. On three nodes behind a load balancer, a session written on node 1 has to be readable on node 3. That&#xA;means the nodes have to know about each other and agree on where data lives. This post is how that works as of&#xA;&lt;a href=&#34;https://github.com/ephpm/ephpm/releases/tag/v0.5.2&#34;&gt;v0.5.2&lt;/a&gt;, including the parts I&amp;rsquo;m not happy with yet.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Custom SAPI - How PHP Actually Talks to the Outside World</title>
      <link>https://luth.io/blog/2026/07/building-a-custom-php-sapi/</link>
      <pubDate>Thu, 30 Jul 2026 20:18:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/07/building-a-custom-php-sapi/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;ve only ever run PHP behind nginx, you&amp;rsquo;ve probably never had to think about how &lt;code&gt;echo&lt;/code&gt; reaches a socket. When&#xA;you embed PHP like &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; does, it&amp;rsquo;s the first thing you have to answer. The answer&#xA;is a SAPI. There is very little written about implementing one. Most of what I know came from reading &lt;code&gt;sapi/cli&lt;/code&gt;,&#xA;&lt;code&gt;sapi/cgi&lt;/code&gt; and &lt;code&gt;sapi/embed&lt;/code&gt; in php-src. Then I found out which parts I&amp;rsquo;d misread. This is the write-up I wanted back&#xA;in March.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SQLite as a Production Database via Protocol Translation</title>
      <link>https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/</link>
      <pubDate>Sat, 25 Jul 2026 20:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/07/sqlite-production-database-protocol-translation/</guid>
      <description>&lt;p&gt;Most of the PHP sites I&amp;rsquo;d put on &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; don&amp;rsquo;t need a MySQL server. A brochure&#xA;WordPress, an internal Laravel tool, a preview environment that lives for an afternoon. What they do need is something&#xA;that &lt;em&gt;looks&lt;/em&gt; like MySQL, because &lt;code&gt;mysqli&lt;/code&gt; and &lt;code&gt;pdo_mysql&lt;/code&gt; are the only database drivers their code has ever been&#xA;pointed at. I mentioned this in the &lt;a href=&#34;https://luth.io/blog/2026/06/ephpm-pragmatism/&#34;&gt;ePHPm pragmatism post&lt;/a&gt; as a one-paragraph&#xA;&amp;ldquo;because&amp;rdquo;. This is the longer version, now that WordPress 7.0 and Laravel 13 both install and run end to end on it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Pragmatism of ePHPm - Every Decision Has a &#34;Because&#34; Behind It</title>
      <link>https://luth.io/blog/2026/06/ephpm-pragmatism/</link>
      <pubDate>Sun, 21 Jun 2026 19:05:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/06/ephpm-pragmatism/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt; tagged &lt;a href=&#34;https://github.com/ephpm/ephpm/releases/tag/v0.1.0&#34;&gt;v0.1.0&lt;/a&gt; this&#xA;week, three months after the first commit. Before the feature list grows any further I want to write down how&#xA;decisions get made on it. This is mostly for myself. The easiest way to ruin a project like this is to let it turn&#xA;into a checklist of things other projects have.&lt;/p&gt;&#xA;&lt;p&gt;The pitch is simple. One binary that runs a PHP app with fewer moving parts than nginx + php-fpm + Redis + MySQL. Every&#xA;feature has to trace back to that. If I can&amp;rsquo;t finish the sentence &amp;ldquo;this exists because&amp;hellip;&amp;rdquo; with a real problem from&#xA;running PHP in production, it doesn&amp;rsquo;t go in.&lt;/p&gt;</description>
    </item>
    <item>
      <title>PHP Signal Safety - The Init Ordering Bug Nobody Warns You About</title>
      <link>https://luth.io/blog/2026/04/php-signal-safety-init-ordering/</link>
      <pubDate>Sun, 12 Apr 2026 20:15:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/04/php-signal-safety-init-ordering/</guid>
      <description>&lt;p&gt;Last week I wrote about &lt;a href=&#34;https://luth.io/blog/2026/04/why-rust-for-php-embedding/&#34;&gt;why ePHPm embeds PHP from Rust&lt;/a&gt; and promised the&#xA;signal bug its own post. Here it is. It&amp;rsquo;s the kind of bug where the fix is about ten lines and the explanation is the&#xA;whole post. Nothing in PHP&amp;rsquo;s embed documentation (there&amp;rsquo;s barely any) tells you that initializing PHP has&#xA;process-wide side effects. Those side effects assume PHP is the only thing in the process.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-setup&#34;&gt;The setup&lt;/h3&gt;&#xA;&lt;p&gt;The first working version of &lt;code&gt;ephpm serve&lt;/code&gt; looked like every async Rust program. It was &lt;code&gt;#[tokio::main]&lt;/code&gt;-style. Build&#xA;the runtime, then inside it load config, initialize PHP and start the HTTP server. PHP requests run on&#xA;&lt;code&gt;spawn_blocking&lt;/code&gt; threads. Simplified:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why Rust for PHP Embedding (Not Go)</title>
      <link>https://luth.io/blog/2026/04/why-rust-for-php-embedding/</link>
      <pubDate>Sun, 05 Apr 2026 19:40:00 -0700</pubDate>
      <guid>https://luth.io/blog/2026/04/why-rust-for-php-embedding/</guid>
      <description>&lt;p&gt;Go is my primary language and has been for a long time. When I started building &lt;a href=&#34;https://github.com/ephpm/ephpm&#34;&gt;ePHPm&lt;/a&gt;&#xA;a few weeks ago the obvious move was to write it in Go. ePHPm is a PHP application server. It&amp;rsquo;s one binary that embeds&#xA;the real PHP interpreter (&lt;code&gt;libphp&lt;/code&gt;, the Zend engine) and puts an HTTP server, TLS, a KV cache and a database proxy&#xA;around it. A PHP app doesn&amp;rsquo;t need nginx + php-fpm + Redis to run. &lt;a href=&#34;https://frankenphp.dev/&#34;&gt;FrankenPHP&lt;/a&gt; already proved&#xA;the &amp;ldquo;PHP inside a Go web server&amp;rdquo; idea works, and it works well. I wrote it in Rust anyway. This post covers the&#xA;reasoning, and the part of the design that Rust made easier and the part it didn&amp;rsquo;t. It also has some numbers I should&#xA;have measured before I wrote the design doc instead of after.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
