[Bug]: herd restart skips PHP versions used only by isolated sites ("Restarting PHP $_sock_...")
まだ誰も着手していません。
評価
調査の方向性
Start by locating PhpFpm::utilizedPhpVersions() and isolatedDirectories(), which the issue identifies as the current version-discovery paths; inspect how stopIfUnused() uses the same version list. Reproduce with a global PHP version and a site isolated to another version, then run herd restart and check whether both PHP-FPM processes get new PIDs. Done when every version used by a site is restarted without the invalid $_sock_ name.
索引モデルが issue の本文から書いたものです。
説明
Platform
macOS
Operating system version
macOS 27.0.1 (26A434)
System architecture
ARM64 (M1, M2, etc)
Herd Version
2.0.2 (Build: 71)
PHP Version
Not version-specific: any version that only isolated sites use. Here: global PHP 8.5.10, a site isolated to PHP 8.4.25.
Bug description
herd restart (and herd restart php) does not restart PHP-FPM for a version that only isolated sites use. Here the global PHP is 8.5 and a site is isolated to 8.4: herd restart prints Restarting PHP $_sock_... and Restarting PHP 8.5..., and afterwards only 8.5 has a new PHP-FPM process; 8.4 keeps its pid and start time (log below). Sites isolated to the global version are not affected, because the global version is always restarted.
Expected: every PHP version that a site uses is restarted.
Impact: low, but silent. Code changes are not affected (with Herd's default OPcache settings PHP picks them up by itself). But for a version that only isolated sites use, a php.ini change (for example memory_limit, upload_max_filesize or an extension) is not applied, and stuck PHP-FPM workers are not cleared, although the CLI says "Herd services have been restarted."
Cause, in herd.phar 2.0.2: in PhpFpm::utilizedPhpVersions(), the first entry of Herd::SUPPORTED_PHP_VERSIONS is 'php', which nginxSockName() turns into $herd_sock_. That is the start of every isolated site's socket name ($herd_sock_84), so the strpos() check matches it first, and str_replace(['herd', '.sock'], ...) turns it into $_sock_. Herd rejects that name ("Invalid PHP version provided", log below), but runAppleScript() discards stderr, so no error shows. stopIfUnused() uses the same list.
Suggestion: read each site's version from its # ISOLATED_PHP_VERSION= line, as isolatedDirectories() already does. Fixing only the prefix match wouldn't be enough: the str_replace() expects herd84.sock-style names and would give $_sock_8.4.
Workaround: quit and reopen Herd.
The same Restarting PHP $_sock_... line shows in output pasted in #402 (Herd 1.4.1) and #1597 (Herd 1.24.2), so this is probably not new.
Steps to reproduce
- Herd 2.0.2 with global PHP 8.5.
- Isolate a site to 8.4:
herd isolate 8.4 --site=example(Herd installs 8.4 if needed). - Note the PHP-FPM main processes:
ps -o pid,lstart,command -p $(pgrep -d, -P $(pgrep -x Herd)) | grep fpm - Run
herd restart. - Run the
pscommand again: 8.5 has a new pid and start time, 8.4 still has the old ones.
Relevant log output
PHP-FPM main processes before herd restart (from ps):
PHP 8.4 started Oct 19 22:35:05 2026 (pid 61676)
PHP 8.5 started Oct 19 22:03:47 2026 (pid 57366)
$ herd restart
Restarting DNSMasq...
Restarting PHP $_sock_...
Restarting PHP 8.5...
Restarting Nginx...
Herd services have been restarted.
PHP-FPM main processes after:
PHP 8.4 started Oct 19 22:35:05 2026 (pid 61676)
PHP 8.5 started Oct 19 22:35:35 2026 (pid 61898)
$ osascript -e 'tell application "Herd" to restart php service "$_sock_"'
27:56: execution error: Herd got an error: Invalid PHP version provided. Available versions are: 8.6, 8.5, 8.4, 8.3, 8.2, 8.1, 8.0, 7.4 (10)
- 主要言語
- 言語のデータがありません
- スター
- 124
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
beyondcode/herd-community のほかの issue
-
macOS
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
beyondcode/herd-community#1774 ·
-
fixed-in-next-release macOS
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
beyondcode/herd-community#1771 ·
-
[Bug]: PHP 8.3 php.ini missing auto_prepend_file and herd-ext extension lines (dump() undefined)オープンmacOS
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
beyondcode/herd-community#1693 ·
-
macOS
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
beyondcode/herd-community#1602 ·
-
[Bug]: herd php:update hangs indefinitely on Windows when background PHP processes hold file locksオープンwindows
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
beyondcode/herd-community#1775 ·
beyondcode/herd-community の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
usage: a custom provider's balance meters ("…%" in the balance path) ignore the Left/Used switchオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Negative subscript on a sparse array counts from the number of elements, not from the highest indexオープンarea: compat bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
reubeno/brush#1570 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ericcornelissen/depreman#591 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信