Skip to content

Latest commit

 

History

History

chrome-devtools

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

About

Use PHP.wasm with Xdebug in Google Chrome Devtools with the Xdebug Bridge

Warning

Debugging with Google Chrome DevTools is still experimental


Appendix

Important

Chrome Devtools retains breakpoints. To reset the Devtools, go to Settings > Preferences > Restore defaults and reload


There are multiple ways to run the Google Chrome Devtools :

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/xdebug-bridge/src/cli.ts

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-xdebug-bridge-3.0.12.tar.gz
...

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

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

3. Installing the necessary packages from NPM

npm install @php-wasm/xdebug-bridge

4. Running package directly from NPX

npx @php-wasm/xdebug-bridge


How to start

1. Copy the specific directory you would like to try

  • php-wasm-node
  • php-wasm-cli
  • wp-playground-cli

2. Follow the dedicated README file instructions