Repository navigation
Conversation
2 of 11 tasks
adamziel
force-pushed
the
try/dlopen3
branch
from
December 20, 2023 23:59
73418e0 to
246cd40
Compare
Collaborator
Author
|
This PR is now much simpler and xdebug functions work! However, connecting to a step debugger doesn't work yet. It seems like xdebug isn't even trying to open a remote socket here: |
Closed
adamziel
force-pushed
the
trunk
branch
2 times, most recently
from
October 4, 2024 09:24
680cd19 to
2e376d2
Compare
Collaborator
Author
|
This is interesting and may enable connecting xdebug to browser devtools: https://github.com/microsoft/debug-adapter-protocol/blob/main/overview.md There's probably already an implementation of xdebug -> debug adapter protocol built for some VS code PHP debugging extension. |
Collaborator
Author
|
Superseded by #2248 |
mho22
added a commit
that referenced
this pull request
Jul 9, 2025
…#2326) ## Motivation for the change This is a pull request to dynamically load Xdebug in `@php-wasm` Node ASYNCIFY. [Roadmap](#2315) ## Related issues and pull requests Relative to XDebug - #2248 - #314 - #2288 - #831 Relative to dynamic library - #89 - #2290 - #673 ## Implementation details Additional steps for asyncify are implemented : - new nx commands - new `WITH_JSPI` and `WITH_DEBUG` arguments in Xdebug Dockerfile - new `xdebug.so` files are compiled and dynamically loaded ## Zend extensions and PHP versions > [!IMPORTANT] > Each version of PHP requires its own version of Xdebug because each version of PHP has a specific Zend Engine API version. Consequently, each version of Xdebug is designed to be compatible with a particular Zend Engine API version. Example using PHP `8.2` with Xdebug `8.3` : ``` Xdebug requires Zend Engine API version 420230831. The Zend Engine API version 420220829 which is installed, is outdated. ``` ## Testing Instructions Two files are needed. A PHP file to test the step debugger. A JS file to run PHP 8.4 node ASYNCIFY. `php/xdebug.php` ```php <?php $test = 42; // Set a breakpoint on this line echo "Hello Xdebug World\n"; ``` `scripts/node.js` ```javascript import { PHP } from '@php-wasm/universal'; import { loadNodeRuntime } from '@php-wasm/node'; const php = new PHP( await loadNodeRuntime( '8.4', { withXdebug : true } ) ); await php.runStream( { scriptPath : `php/xdebug.php` } ); ``` To achieve the test, you first need to start debugging [ with F5 or Run > Start debugging in VSCode ], then run : ```bash node scripts/node.js ```
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.
What is this PR doing?
Explores support for dynamic loading of PHP extensions.
Supersedes #673, consult that PR for the progress history and helpful comments.
Related to #314, #655, #89
Minimal dlopen example without PHP involved.
Testing instructions
Clone this branch to a directory with path
/Users/cloudnik/www/Automattic/core/plugins/playground-2/wordpress-playground. It's not great, I know. I want to remove the explicit path dependency soon.Then, create a
/usr/local/etc/php.inifile with the following contents:Finally, run:
Here's what you should see:
Remaining work
trunk. This PR ships many stale files.