What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Alrighty PHPStorm friends πŸ˜†, setting up XDebug Mac osX (version in screen capture) Brave B

U01JBB8LNTE
U01JBB8LNTE Posts: 207 πŸ§‘πŸ»β€πŸš€ - Cadet

Alrighty PHPStorm friends πŸ˜†, setting up XDebug

Mac osX (version in screen capture)
Brave Browser: Version 1.18.78 Chromium: 87.0.4280.141 (Official Build) (x86_64)

PhpStorm 2020.3.2
Build #PS-203.7148.74, built on January 27, 2021
Licensed to PhpStorm Evaluator
Expiration date: March 7, 2021
Runtime version: 11.0.9.1+11-b1145.77 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.16
GC: ParNew, ConcurrentMarkSweep
Memory: 725M
Cores: 16
Registry: run.processes.with.pty=TRUE

1. Xdebug is installed with `pecl install xdebug
````
❯ php --version
PHP 8.0.1 (cli) (built: Jan  8 2021 12:43:54) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
    with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
    with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies
  1. docker sdk is up and running with `docker/sdk up -x
    ````
    Recreating spryker_b2c_dev_frontend_1 ... done
    Recreating spryker_b2c_dev_gateway_1 ... done
    Restarting spryker_b2c_dev_gateway_1 ... done
    Restarting spryker_b2c_dev_frontend_1 ... done
    Checking is demo data loaded for EU... 1s [LOADED]
    Checking is demo data loaded for US... 1s [LOADED]
    Checking jobs are installed... 1s [INSTALLED]
    ```
  2. xdebug is enabled in PHPStorm and cli interpretor set (see pic)
  3. Xdebug helper ext installed in brave and PHPStorm key set (see pic)
  4. spryker server is setup with /data mapped
  5. set a breakpoint all the little lights are green, would expect it to wait at breakpoint
  6. what step am i missing?

Comments

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 πŸ§‘πŸ»β€πŸš€ - Cadet

    Host should be spryker.local instead of spryker (screen 4)

  • U01JBB8LNTE
    U01JBB8LNTE Posts: 207 πŸ§‘πŸ»β€πŸš€ - Cadet

    hm... tried that I think...

    first frame verifies that the url is correct
    second is where I would expect the breakpoint to stop

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 πŸ§‘πŸ»β€πŸš€ - Cadet

    no need to create the PHP Remote Debug configuration..PhpStorm introduced zero-configuration debugging

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 πŸ§‘πŸ»β€πŸš€ - Cadet

    I recommend enabling Break at the first line in PHP scripts in the Run menu and then try debugging from cli first:

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 πŸ§‘πŸ»β€πŸš€ - Cadet

    docker/sdk console -x -vvv

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 πŸ§‘πŸ»β€πŸš€ - Cadet

    oh..when did you set up the project? Xdebug was broken was Friday

  • U01LE4BMBK7
    U01LE4BMBK7 Posts: 241 πŸ§‘πŸ»β€πŸš€ - Cadet

    make sure to do:

    cd docker
    git pull
    cd ..
    docker/sdk bootstrap deploy.dev.yml
    
  • U01N2CTGQKS
    U01N2CTGQKS Posts: 1 πŸ§‘πŸ»β€πŸš€ - Cadet

    try to update your docker sdk (cd to the docker directory and run β€˜git pull’ ). There was an update that introduces support for xdebug 3

  • U01JBB8LNTE
    U01JBB8LNTE Posts: 207 πŸ§‘πŸ»β€πŸš€ - Cadet

    this is zero-configuration debugging huh? 🀣 sorry a bit frustrate... disabling sarcasm

    disabled PHP remote debug ... although I'm not sure about that one tbh

    cd docker
    git pull > on branch master
    docker/sdk bootstrap deploy.dev.yml
    docker/sdk console -x -vvv
     # Break at the first line in PHP scripts >> enabled
    

    That breaks at index.php, cool smoke test βœ…

     # Break at the first line in PHP scripts >> disabled
     # Xdebug Helper >> debug
     # reload page with breakpoint
    

    Debug session was finished without being paused

                It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
                To figure out the problem check path mappings configuration for 'spryker' server at PHP|Servers or enable Break at first line in PHP scripts option (from Run menu).
                Do not show again
    

    tried both spryker & spryker.local

    https://www.jetbrains.com/help/phpstorm/2021.1/zero-configuration-debugging.html

  • U01JBB8LNTE
    U01JBB8LNTE Posts: 207 πŸ§‘πŸ»β€πŸš€ - Cadet

    path mapping looks ok... I think.. ?