[Bug]: herd php:update hangs indefinitely on Windows when background PHP processes hold file locks
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Start by tracing the herd php:update command to Herd::updatePHP() and its makeAppRequest("update-php/{$version}") call; inspect the Windows update and extraction path described in the issue. Reproduce with a background PHP process holding files in bin\php85, then check the CLI and Settings GUI behavior. Done means updates report a clear failure or complete despite those locks, requests cannot hang indefinitely, and the GUI refreshes update availability.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Platform
Windows
Operating system version
Windows 11 (Build 26220)
System architecture
Windows
Herd Version
2.0.2
PHP Version
PHP 8.5.9 (cli) (built: Jul 28 2026 13:21:17) (NTS)
Bug description
What happened:
When running herd php:update 8.5 in terminal (or clicking the "Update" button in the Herd Settings GUI), the update process hangs indefinitely after displaying:
INFO Updating PHP 8.5...
Looking at the logs in %APPDATA%\Herd\logs\main.log, Herd successfully stops the local CGI service and completes downloading https://download.herdphp.com/8.5/php85-win.zip (36 MB) to %TEMP%\php-8.5.zip. However, the process stalls completely right after the download finishes.
Root cause:
On Windows NTFS, running executables and loaded DLLs (php.exe, php8.dll, libpq.dll, libssl-3-x64.dll, etc.) are locked exclusively by the operating system (ERROR_LOCK_VIOLATION / EBUSY). When a developer has active background processes running under that PHP version (such as composer run dev, php artisan serve, queue:listen, reverb:start, or pulse:work), any attempt to overwrite or extract files directly into bin\php85 in-place is blocked by Windows.
Because Herd::updatePHP() delegates to makeAppRequest("update-php/{$version}") via curl_exec without a timeout or file-lock pre-check, both the CLI command and the desktop background process remain stuck in limbo indefinitely.
Additionally, once the binary is manually updated, the Herd Settings GUI detects the new version string (e.g. 8.5 (8.5.11)), but the red Update button remains visible because updateAvailable is cached in memory and not refreshed until the Herd desktop application is completely exited and reopened.
What was expected:
- Herd should pre-check whether any
php.exeprocesses originating frombin\php<version>are currently active. If so, fail gracefully with an informative warning:"Cannot update PHP while processes using this version are running. Please stop active dev servers (e.g., artisan serve, queue workers) and try again."
- Alternatively, perform an atomic folder swap (Windows best practice): In Windows, while files inside a folder cannot be overwritten while in-use, the parent directory
bin\php85can be renamed tobin\php85_old, and the new version extracted to a cleanbin\php85. Running workers will continue smoothly fromphp85_olduntil restarted, while new executions immediately use the updated PHP 8.5.11 binaries. - Add a timeout and proper error reporting to
makeAppRequestso the CLI never hangs indefinitely.
Steps to reproduce
- On Windows, start any long-running PHP process using the target PHP version (e.g., in a Laravel project run
composer run devorphp artisan serve). - Open a separate terminal and run:
(Or click "Update" next to PHP 8.5 in the Herd Settings GUI).herd php:update 8.5 - Observe that the command hangs indefinitely at
INFO Updating PHP 8.5.... - Inspect
%APPDATA%\Herd\logs\main.logto see thatDownload completewas logged, but no extraction or completion ever happens.
Relevant log output
[info] Stopping PHP-8.5 with PID 4732
[info] Stopped PHP-8.5
[info] PHP-8.5 exited
[info] Deleted PID file C:\Users\<User>\.config\herd\.pid\php-8_5.pid
[info] Notifying windows of service update: PHP-8.5 - inactive
[info] Downloading PHP 8.5 (8.5.11) from https://download.herdphp.com/8.5/php85-win.zip to C:\Users\<User>\AppData\Local\Temp\php-8.5.zip
[info] Total length: 36048897
[info] Download complete
- 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 ·
-
windows
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
beyondcode/herd-community#1778 ·
Tất cả issue của beyondcode/herd-community
Issue tương tự
-
a:false-positive
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
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 72/100
coollabsio/coolify#12274 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
opensearch-project/opensearch-migrations#3480 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày