wordpress-playground
wordpress-playground copied to clipboard
Draft: XDebug support via dlopen
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.ini
file with the following contents:
allow_url_fopen=1
extension=/Users/cloudnik/www/Automattic/core/plugins/playground-2/wordpress-playground/packages/php-wasm/node/public/mbstring.so
zend_extension=/Users/cloudnik/www/Automattic/core/plugins/playground-2/wordpress-playground/.libs/xdebug.so
xdebug.mode=debug
sys_temp_dir=/tmp
Finally, run:
$ nx reset; PHP=8.2 nx start php-wasm-cli -z ./.libs/xdebug.so ./test.php
Here's what you should see:
Remaining work
- [x] Reconcile this branch with
trunk
. This PR ships many stale files. - [x] Clean up the code
- [ ] Make this work with any disk path, not just the one listed above
- [ ] Make XDebug step debugger work