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..

Hey guys, Can any one help me with how to setup `xdebug` on B2C demo project. As I understand, we

U032TRF4HJN
U032TRF4HJN Posts: 14 πŸ§‘πŸ»β€πŸš€ - Cadet

Hey guys, Can any one help me with how to setup xdebug on B2C demo project.

As I understand, we start the xdebug with ./docker/sdk start -x command .

However when selecting Image for container in PHPStorm, there are a lots of image, so which one do we select, Any Idea?

Comments

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βš–οΈ - Guardians (admin)
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βš–οΈ - Guardians (admin)

    did you do a docker/sdk bootstrap deploy.dev.yml ?

  • U032TRF4HJN
    U032TRF4HJN Posts: 14 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi Florian,

    Yup I used docker/sdk bootstrap deploy.dev.yml

    And thanks, I thought I had to setup CLI interpreters to properly link everything in PHP Storm with xdebug. Well thats how I used to do before, but by just adding servers it seems like now I am close to running xdebug.

    At least now it breaks in the first line but I have this errors Server with name spryker does not exists . I will check this further

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 πŸͺ - Explorer

    The name of the server (2. screenshot) is wrong and should be "spryker" instead.

  • U032TRF4HJN
    U032TRF4HJN Posts: 14 πŸ§‘πŸ»β€πŸš€ - Cadet

    oh boy πŸ˜„ it works perfectly now . Thanks @UL6DGRULR πŸ™ Appreciate the help

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 πŸ§‘πŸ»β€πŸš€ - Cadet

    Fyi:
    For me, starting a xdebug session using cookies works without running the containers explicitly in debug mode (-x param). But for whatever reason, starting a debug session using url/post params (?XDEBUG_SESSION_START=…) won’t work without debug mode …

  • U032TRF4HJN
    U032TRF4HJN Posts: 14 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UPWG9AYH2 Seems to work for me even from postman. I used this . may be check your value of XDEBUG_SESSION_START=phpstorm

    <http://glue.de.spryker.local/catalog-search?q=a&XDEBUG_SESSION_START=phpstorm>
    
  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited March 2022

    ran docker/sdk up with or without -x param?

  • U032TRF4HJN
    U032TRF4HJN Posts: 14 πŸ§‘πŸ»β€πŸš€ - Cadet

    I had run with debug mode. I think if we want to use xdebug, we always need to run with -x param to set xdebug on, no? πŸ€”.

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 πŸ§‘πŸ»β€πŸš€ - Cadet

    No, that was exactly the point πŸ˜„ for me it was never needed to run containers in xdebug mode when starting a debug session from browser (using xdebug helper) … but it would not work starting it via url/post params as far as the xdebug container were not started in debug mode^^ …

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βš–οΈ - Guardians (admin)

    there are also several browser extensions for xdebug - with these you can start the environment without the β€œ-x” option and enable debugging via browser. saves some resources when you dont need to debug πŸ˜‰

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited March 2022

    I am curious why its working with cookies (via browser extension OR postman for example) but not via post/url params ootb (regardless postman or browser) … as far as i understood, the difference between -x and without -x is that the xdebug module is not loaded at all (php -m wont show any xdebug extesion) … but nevertheless it seems to work in the cookie case … another guess: url params are not passed to the corresponding place to trigger a session … but yeah i dont know … very strange to me^^

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βš–οΈ - Guardians (admin)

    without -x the module should still be loaded but somehow not enabled // listening - but i dont know how it works. I guess it is a default xdebug functionality since this is not spryker specific

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 πŸ§‘πŸ»β€πŸš€ - Cadet

    Good to know, at least for me, switching between debug modes is very unpractical …