[Bug]: herd restart skips PHP versions used only by isolated sites ("Restarting PHP $_sock_...")
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 124
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của beyondcode/herd-community
-
macOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
beyondcode/herd-community#1774 ·
-
fixed-in-next-release macOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
beyondcode/herd-community#1771 ·
-
[Bug]: PHP 8.3 php.ini missing auto_prepend_file and herd-ext extension lines (dump() undefined)Đang mởmacOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
beyondcode/herd-community#1693 ·
-
macOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
beyondcode/herd-community#1602 ·
-
[Bug]: herd php:update hangs indefinitely on Windows when background PHP processes hold file locksĐang mởwindows
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
beyondcode/herd-community#1775 ·
Tất cả issue của beyondcode/herd-community
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`rtk ruff -- <path>` drops the leading `--`, so `rtk ruff -- check` lints the whole directoryĐang mởarea:cli bug good first issue priority:medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
rtk-ai/rtk#4702 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vybestack/llxprt-code#3917 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
windows: installCliGlobally still runs npm.cmd directly without a shell (EINVAL on Node >= 18.20.2)Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
n0mad-ai/bastra-recall#1274 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jbacalso24/mimry#525 ·
Maintainer thường phản hồi trong vòng 1 ngày