Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 2.06 KB

xdebug.md

File metadata and controls

43 lines (34 loc) · 2.06 KB

Setup xDebug in phpStorm

Let's debugging

  • Here we want to configure our PHP docker interpreter. a. Go to Preferences > PHP, add new interpreter, select new interpreter from Docker, vagrant, etc... Alt Text Alt Text

  • Create new Server. Alt Text Alt Text

  • After selecting an Interpreter, we are going to map our working project with container path, my working project path is $HOME/Projects/terragrunt docker and I will map into .env > DOCKER_WORK_DIR, so change the Docker container value: Alt Text

  • This the result : Alt Text

Xdebug configuration.

  • Go to Preferences > PHP > Debug, set like this: Alt Text
  • Go to Preferences > PHP > Debug > Dbgp Proxy, set like this (note: IDE Key must same with the value of xdebug.idekey on php.ini): Alt Text
  • Go to Run > Edit Configurations..., create a new PHP Remote Debug configuration: Alt Text Alt Text
  • Go to Run > Web Server Debug Validation, on Path to create validation script I point the value into my public path of project, and URL to validation script I point to my nginx docker host. Alt Text

EXECUTE!

  • Set breakpoint, and turning on Start Listening for PHP Debug Connection Alt Text Alt Text
  • Go to Run > Debug then select the configuration what we made earlier (PHP Remote Debug): Alt Text
  • Go to your endpoint, and add query string with parameter XDEBUG_SESSION_START and the value is your IDE Key, then execute! Alt Text
  • Or if you need debugging in browser use this extension - Xdebug helper