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

anyB setup xdebug for their spryker project using vscode on mac osX? Think I'm decently close 1. V

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

anyB setup xdebug for their spryker project using vscode on mac osX?

Think I'm decently close

  1. VSCode > Install PHP Debug felixfbecker.php-debug
  2. brew install php
  3. pecl install xdebug
  4. run php -m -c
bash
...
[Zend Modules]
Xdebug
Zend OPcache
  1. setup configuration through vscode with launch,json
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: <https://go.microsoft.com/fwlink/?linkid=830387>
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/data": "${workspaceRoot}",
            },
            "log": true
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

Comments

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

    I can set breakpoints but not really sure how to test to make sure they are actually working?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can try setting breakpoints in public/Yves(Zed)/index.php f.e. in

    Environment::initialize();
    

    or below. And then just access whatever

  • rshopin
    rshopin Senior Solution Architect Sprykee Posts: 32 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited February 2021

    "port":9000,
    PHP-FPM by default also using port 9000, check it, if yes - change xdebug port to 9001 in xdebug.ini or reconfigure PHP to use unix socket

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    xdebug 3 uses 9003 as port

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet
  • U01JBB8LNTE
    U01JBB8LNTE Posts: 207 πŸ§‘πŸ»β€πŸš€ - Cadet
    xdebug
    
    __   __   _      _
    \ \ / /  | |    | |
     \ V / __| | ___| |__  _   _  __ _
    
    
      < / _

    looks like I'm on 3 already

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

    so I'm guessing that means I need to use 9003...

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    yeah and some other vars has changed too

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet
    xdebug.client_host=host.docker.internal
    xdebug.client_port=9003
    xdebug.mode=develop,debug,coverage
    xdebug.start_with_request=trigger
    xdebug.output_dir="/var/www/spryker/releases/current/data/xdebug"
    xdebug.max_nesting_level=1000
    

    i use this config