Skip to content

fix(windows): ensure DLLs can always be located by PHP#2227

Open
dunglas wants to merge 5 commits intomainfrom
fix/dll-dir
Open

fix(windows): ensure DLLs can always be located by PHP#2227
dunglas wants to merge 5 commits intomainfrom
fix/dll-dir

Conversation

@dunglas
Copy link
Member

@dunglas dunglas commented Feb 28, 2026

Prevent crashes when php.ini references PHP extensions using relative paths, and FrankenPHP is started from a different working directory than the one containing extensions, or with caddy start (instead of caddy run).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves FrankenPHP’s Windows startup behavior so PHP can reliably locate and load extensions/DLL dependencies when php.ini uses relative paths and FrankenPHP is launched with a different working directory (e.g., caddy start).

Changes:

  • On Windows, derives the FrankenPHP module directory at startup and sets it as the DLL search directory before PHP startup proceeds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Use a 32K buffer instead of MAX_PATH to support long module paths,
and check SetDllDirectoryW return value, logging on failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@henderkes
Copy link
Contributor

Looks good on mobile now, but I'll give it a proper review in a few days on my laptop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants