Skip to content

mho22/php-wasm-xdebug-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

About

Use PHP.wasm with Xdebug


Appendix

There are mostly four ways to run PHP.wasm :

1. Directly from the WordPress Playground repository

cd wordpress-playground
// PHP.wasm CLI
node \
--no-warnings=ExperimentalWarning \
--experimental-strip-types \
--experimental-transform-types \
--import ./packages/meta/src/node-es-module-loader/register.mts \
./packages/php-wasm/cli/src/main.ts --xdebug
// Playground CLI
node \
--no-warnings=ExperimentalWarning \
--experimental-strip-types \
--experimental-transform-types \
--import ./packages/meta/src/node-es-module-loader/register.mts \
./packages/playground/cli/src/cli.ts server --xdebug

2. Running the local-package-repository script in the WordPress Playground repository

cd wordpress-playground

npm run local-package-repository

...
http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@php-wasm-universal-3.0.12.tar.gz
http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@php-wasm-node-3.0.12.tar.gz
http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@php-wasm-cli-3.0.12.tar.gz
http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@wp-playground-cli-3.0.12.tar.gz
...

The requested lines must be be added in your separate project's package.json file :

{
  "type": "module",
  "dependencies": {
    "@php-wasm/node": "http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@php-wasm-node-3.0.12.tar.gz",
    "@php-wasm/cli": "http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@php-wasm-cli-3.0.12.tar.gz",
    "@wp-playground/cli": "http://127.0.0.1:9724/7840495c41d5c5ae535da114/v3.0.12/@wp-playground-cli-3.0.12.tar.gz"
  }
}
npm install

3. Installing the necessary packages from NPM

npm install @php-wasm/node @php-wasm/cli @wp-playground/cli

4. Running packages directly from NPX [PHP.wasm CLI and WP-Playground/CLI only]

npx @php-wasm/cli --xdebug

npx @wp-playground/cli server --xdebug


How to start

1. Choose the environment you want to use Xdebug in

  • chrome-devtools
  • ide

2. Follow the dedicated README file instructions

About

PHP.wasm with Xdebug enabled examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published