ScandiPWA (deprecated)
User ManualGitHubSlack
  • ScandiPWA (deprecated)
  • React & PWA for dummies
    • Setting Up Environment and Talking Theory
    • Learning React Hands-on
    • Styling It
    • Learning ScandiPWA Way
  • START & UPGRADE
    • Linux Docker setup
    • Mac Docker setup
    • Setting up the theme with remote M2 server
    • Theme Upgrade to the latest version
    • Automated setup (BETA)
  • A TO Z OVERVIEW
    • Motivation
    • Challenges
    • File structure and UI components
    • Rewriting and Extending A Theme
  • DESCRIPTION OF CONTAINERS
    • Ngrok
  • FAQ
    • Development
    • Installation
    • Billing and license
    • Product support
    • What is PWA?
  • HOW-TO TUTORIALS - INTRODUCTORY
    • Base template
    • Connecting to the GraphQL resolver
    • Extension mechanism
    • Creating GraphQL resolver
    • Debugging and Inspecting
    • Setting Up Frontend
    • File Structure
    • Data Flow
    • Technology Stack
    • Changing environment
    • Theme Build and Configuration
    • Implementing Caching for New Caching Identities
    • Implementing a parent theme
  • HOW-TO TUTORIALS - INTERMEDIATE
    • Debugging in Chrome
    • Configuring XDebug
    • CLI in Docker
    • Postman & GraphQL Playground
    • VSCode Extensions
    • Plugins: implementing
    • Plugins: using and publishing
    • ESlint & StyleLint
    • How To Contribute
    • Migrating to a Newer Version
    • Installation on Existing Magento 2 Sever
    • BEM and Coding Standards
    • Tools of ScandiPWA
    • React Best Practices
  • FAQ
    • Untitled
Powered by GitBook
On this page
  • Setup
  • Debugger settings in PhpStorm IDE
  • Setting up IP alias
  • Linux
  • macOS
  1. HOW-TO TUTORIALS - INTERMEDIATE

Configuring XDebug

PreviousDebugging in ChromeNextCLI in Docker

Last updated 4 years ago

Setup

php with xdebug is can be set for local, by changing $PROJECT_IMAGE variable to xdebug in corresponding .env files, ensuring corrent docker image to be used.

Debugger settings in PhpStorm IDE

Now to set the PhpStorm, go to:

Preferences > Languages & Frameworks > PHP > Debug

In this window check the following settings:

  • Xdebug section, set port 9111

  • “Can accept external connections” is checked

  • “Ignore external connections through unregistered server configurations” is checked

  • Other settings is up to your preferences of the debugger

Now we need to set up a server configuration, to map local files to remote application container, head to:

_Languages & Frameworks > PHP > Debug > Servers__

  • Add new configuration by clicking the + symbol

  • Host:

  • Port: 3001, which is default nginx port, try to avoid using varnish port and disable varnish in magento configuration during debug sessions

  • Debugger: Xdebug

  • And map your local ./src/ directory to remote /var/www/public

Setting up IP alias

To allow connections from container to debug console in PhpStorm you need to add following alias to you system, this setting is not persisted between restarts, update your env accordingly

Linux

sudo ip address add 172.254.254.254/24 dev docker0

macOS

sudo ifconfig en0 alias 172.254.254.254 255.255.255.0

Now the configuration is complete, happy debugging!

Xdebug setup