Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[Bug]: herd php:update hangs indefinitely on Windows when background PHP processes hold file locks

Offen
#1,775 6 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
php
Bereich
devtools

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

windows
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:

  1. Herd should pre-check whether any php.exe processes originating from bin\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."

  2. 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\php85 can be renamed to bin\php85_old, and the new version extracted to a clean bin\php85. Running workers will continue smoothly from php85_old until restarted, while new executions immediately use the updated PHP 8.5.11 binaries.
  3. Add a timeout and proper error reporting to makeAppRequest so the CLI never hangs indefinitely.
Steps to reproduce
  1. On Windows, start any long-running PHP process using the target PHP version (e.g., in a Laravel project run composer run dev or php artisan serve).
  2. Open a separate terminal and run:
    herd php:update 8.5
    
    (Or click "Update" next to PHP 8.5 in the Herd Settings GUI).
  3. Observe that the command hangs indefinitely at INFO Updating PHP 8.5....
  4. Inspect %APPDATA%\Herd\logs\main.log to see that Download complete was 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
Vorherrschende Sprache
Keine Sprachdaten
Sterne
124
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus beyondcode/herd-community

Alle Issues in beyondcode/herd-community

Ähnliche Issues

Weitere Issues zu DevTools

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.