Build PHP binaries with Xdebug - #3439
Merged
Merged
Conversation
fredrikekelund
commented
May 13, 2026
| artifact_arch: aarch64 | ||
| binary_name: php | ||
| extensions: &macos_php_extensions apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,ftp,gd,gettext,iconv,igbinary,imagick,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,readline,redis,session,shmop,simplexml,sockets,sodium,sqlite3,ssh2,tokenizer,xml,xmlreader,xmlwriter,xsl,yaml,zip,zlib | ||
| extensions: &macos_extensions apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,ftp,gd,gettext,iconv,igbinary,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,readline,redis,session,shmop,simplexml,sockets,sodium,sqlite3,ssh2,tokenizer,xdebug,xml,xmlreader,xmlwriter,xsl,yaml,zip,zlib |
Contributor
Author
There was a problem hiding this comment.
I've removed imagick. I'd love to keep it in, but it's not included in the official php.net Windows build, so I skipped it for now.
1 task
fredrikekelund
marked this pull request as ready for review
May 13, 2026 14:20
fredrikekelund
added a commit
that referenced
this pull request
May 19, 2026
## Related issues <!-- Link a related issue to this PR. If the PR does not immediately resolve the issue, for example, it requires a separate deployment to production, avoid using the "Fixes" keyword and use "Related to" instead. --> - Follow up to #3439 - Fixes RSM-2698 ## How AI was used in this PR <!-- Help reviewers understand what to look for and verify that you've reviewed the code yourself. --> Claude drove the entire implementation based on a detailed spec from me. ## Proposed Changes #3439 changes the structure of the PHP package for Windows so that the extensions are no longer static but are distributed as separate DLL files. To account for this, we need to tell PHP where to find the extension files and to activate them. This PR does that. This PR also activates Xdebug when the `enableXdebug` config is true. ## Testing Instructions <!-- Add as many details as possible to help others reproduce the issue and test the fix. "Before / After" screenshots can also be very helpful when the change is visual. --> 1. Be on Windows 2. Download the Windows build from [here](https://github.com/Automattic/studio/actions/runs/25800854923) 3. Extract it to `C:\Users\USERNAME\.studio\php-bin\8.4` (replace the existing content) 4. `npx cross-env STUDIO_RUNTIME=native-php npm start` 5. Create a new site with PHP 8.4 6. Ensure that it starts as expected 7. Activate Xdebug in the site settings 8. Ensure that it works (you can add a `phpinfo.php` file in the site root and put a `phpinfo()` call in there for verification) ## Pre-merge Checklist <!-- Complete applicable items on this checklist **before** merging into trunk. Inapplicable items can be left unchecked. Both the PR author and reviewer are responsible for ensuring the checklist is completed. --> - [ ] Have you checked for TypeScript, React or other console errors?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
Codex and Claude were both used heavily to iterate on the build script, even if we ultimately arrived at a relatively simple change compared to
trunk.Proposed Changes
We use crazywhalecc/static-php-cli to build PHP binaries. The big selling point of that project is that it can bundle PHP extensions into the binary itself (normally they're distributed as separate
.so/.dllfiles, so called "shared" extensions). It turns out that Xdebug cannot be compiled into the static PHP binary (docs). AFAICT, this is an inherent limitation in Xdebug.However, static-php-cli can actually handle shared extensions, too. Adding support for Xdebug specifically seems to have been a key motivation behind implementing this. The only blocker is that this only works on Posix systems, not on Windows.
So, to get Xdebug support on both platforms, this PR does the following:
ext/xdebug.soextdirectory.runtime.jsonfile for both platforms that serves as a reference for the build version, where the binary lives, and where the extension directory is. I'm not sure how useful this will be in practice, but it seems like a decent idea.Testing Instructions
I'll run the GitHub Actions workflow for all supported PHP versions and manually confirm the output.
Pre-merge Checklist