beyondcode / beyondcode/herd-community

[Bug]: find-usable-php.php ignores Global PHP Version setting, breaks bundled Reverb service after installing PHP 8.5 on Windows

Open
#1,738 0 comments 0 reactions 0 assignees View on GitHub
windows
Dominant language
No language data
Stars
122
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### Platform

Windows

### Operating system version

11

### System architecture

Intel (x86)

### Herd Version

1.29.0

### PHP Version

8.5.9 (issue occurs regardless of Global PHP Version setting)

### Bug description

Installing PHP 8.5 via Herd's PHP tab silently reroutes Herd-managed internal services (specifically the bundled Reverb service) onto PHP 8.5, even when "Global PHP Version" in the Dashboard is explicitly set to a different version (8.4 in my case). This happens because find-usable-php.php (in %USERPROFILE%\.config\herd\bin\) hardcodes a preference order that always checks for PHP 8.5 first:

if (file_exists($binPath . '85' . DIRECTORY_SEPARATOR . 'php.exe')) {
echo $binPath . '85' . DIRECTORY_SEPARATOR . 'php.exe';
} elseif (file_exists($binPath . '84' . DIRECTORY_SEPARATOR . 'php.exe')) {
echo $binPath . '84' . DIRECTORY_SEPARATOR . 'php.exe';
}

This logic does not consult the user's configured Global PHP Version at all — it just picks the highest version available on disk. Any Herd-internal service resolved via this script (Reverb confirmed; possibly others) will silently switch PHP versions the moment a newer version is installed, regardless of user configuration.

Compounding this: Herd's bundled Reverb service (.config\herd\bin\services\reverb\1.x\) ships with a Laravel version that still calls mb_split() internally in Illuminate\Support\Str. PHP 8.5's Windows mbstring build in Herd does not implement mb_split():

php85 -r "var_dump(function_exists('mb_split'));" → bool(false)
php84 -r "var_dump(function_exists('mb_split'));" → bool(true)
php83 -r "var_dump(function_exists('mb_split'));" → bool(true)

The combination causes the bundled Reverb service to fatal-error on startup as soon as PHP 8.5 is installed — even on projects that have nothing to do with 8.5.

### Steps to reproduce

1. Fresh Herd install on Windows, Global PHP Version set to 8.4, Reverb service running normally
2. Install PHP 8.5 via Herd → PHP tab → Install
3. Restart the Reverb service (or fully quit/reopen Herd)
4. Reverb fails to start with a fatal error, despite Global PHP Version still showing 8.4 in the Dashboard
5. Uninstalling PHP 8.5 immediately resolves the issue with no other changes

### Relevant log output

```shell
In Str.php line 1722:
Call to undefined function Illuminate\Support\mb_split()
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with %USERPROFILE%\.config\herd\bin\find-usable-php.php and reproduce the PHP 8.5/8.4 selection while Global PHP Version is set to 8.4. Trace how Herd-managed services choose their PHP executable, then verify the bundled Reverb service starts with the configured version without the reported mb_split fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.