Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jamesstout/fd6eae2b2ba34e7f32ff3e1a179d55fe to your computer and use it in GitHub Desktop.
Save jamesstout/fd6eae2b2ba34e7f32ff3e1a179d55fe to your computer and use it in GitHub Desktop.

Revisions

  1. jamesstout revised this gist Jul 21, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vagrant-vscode-php-xdebug-instructions.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@

    - You've installed [Xdebug](https://xdebug.org/docs/install) in your VM.
    - You've installed [Xdebug extension for VSCode](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) and reloaded/restarted VSCode.
    - You have **not** forwarded port 9000 from the guest to the host.
    - Configure Debugger in VSCode. See item 1 next.

    ## 1. Configure .vscode/launch.json
  2. jamesstout revised this gist Jul 14, 2018. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions vagrant-vscode-php-xdebug-instructions.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    ## 0. Assumptions

    - You've installed [XDebug](https://xdebug.org/docs/install) in your VM.
    - You've installed [XDebug extension for VSCode](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) and reloaded/restarted VSCode.
    - You've installed [Xdebug](https://xdebug.org/docs/install) in your VM.
    - You've installed [Xdebug extension for VSCode](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) and reloaded/restarted VSCode.
    - Configure Debugger in VSCode. See item 1 next.

    ## 1. Configure .vscode/launch.json
    @@ -84,15 +84,15 @@ xdebug
    Xdebug
    ```

    ## 3. Install an XDebug helper for your browser
    ## 3. Install an Xdebug helper for your browser

    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourserlf.
    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourself.

    Here's one for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper) and one for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/).

    ## 4. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands palette.
    2. __Set a breakpoint__ in the file/line where you want to pause the execution __clicking to the left of the line number in the editor.__ You'll see a _gray_ (unverified) or _red_ (verified) dot.
    3. __Make sure the helper is active__ (usually in green) or add the URL parameter, and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    4. Happy debugging!
  3. jamesstout revised this gist Jul 14, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vagrant-vscode-php-xdebug-instructions.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ xdebug.remote_host = 10.0.2.2
    xdebug.remote_log = /var/log/xdebug.log
    ```

    If you're not sure about the remote.host, execute `route -nee` on the VM and look for the gateway:
    If you're not sure about the `remote.host`, execute `route -nee` on the VM and look for the gateway:
    ``` bash
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
  4. jamesstout revised this gist Jul 14, 2018. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions vagrant-vscode-php-xdebug-instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    <!-- # Debugging PHP with VSCode and Vagrant -->

    ## 0. Assumptions

    - You've installed [XDebug](https://xdebug.org/docs/install) in your VM.
    - You've installed [XDebug extension for VSCode](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) and reloaded/restarted VSCode.
    - Configure Debugger in VSCode. See item 1 next.

    ## 1. Configure .vscode/launch.json

    ``` json
    @@ -80,13 +86,13 @@ Xdebug

    ## 3. Install an XDebug helper for your browser

    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourself.
    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourserlf.

    Here's one for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper) and one for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/).

    ## 4. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands palette.
    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. __Set a breakpoint__ in the file/line where you want to pause the execution __clicking to the left of the line number in the editor.__ You'll see a _gray_ (unverified) or _red_ (verified) dot.
    3. __Make sure the helper is active__ (usually in green) or add the URL parameter, and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    4. Happy debugging!
  5. jamesstout renamed this gist Jul 14, 2018. 1 changed file with 0 additions and 0 deletions.
  6. jamesstout revised this gist Jul 14, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Debugging PHP with VSCode and Vagrant
    <!-- # Debugging PHP with VSCode and Vagrant -->

    ## 1. Configure .vscode/launch.json

  7. jamesstout revised this gist Jul 14, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -80,13 +80,13 @@ Xdebug

    ## 3. Install an XDebug helper for your browser

    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourserlf.
    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourself.

    Here's one for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper) and one for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/).

    ## 4. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands palette.
    2. __Set a breakpoint__ in the file/line where you want to pause the execution __clicking to the left of the line number in the editor.__ You'll see a _gray_ (unverified) or _red_ (verified) dot.
    3. __Make sure the helper is active__ (usually in green) or add the URL parameter, and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    4. Happy debugging!
  8. jamesstout revised this gist Jul 14, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -93,4 +93,4 @@ Here's one for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper)

    ## 5. Credits

    Heavily inspired by @sveggiani, indeed this is a fork of his gist. Thank you Sebastián.
    Heavily inspired by [@sveggiani](https://github.com/sveggiani), indeed this is a fork of his gist. Thank you Sebastián.
  9. jamesstout revised this gist Jul 14, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -93,4 +93,4 @@ Here's one for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper)

    ## 5. Credits

    Heavily isnspired/copied
    Heavily inspired by @sveggiani, indeed this is a fork of his gist. Thank you Sebastián.
  10. jamesstout revised this gist Jul 14, 2018. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,6 @@

    ``` 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": [
    {
  11. jamesstout revised this gist Jul 14, 2018. 1 changed file with 71 additions and 47 deletions.
    118 changes: 71 additions & 47 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,75 +1,99 @@
    # Configure XDebug, Visual Studio Code for a Vagrant VM

    ## 1. Assumptions

    - Project (Drupal) is served on `/var/www/html` in the Vagrant box
    - Local project files location: `c:\Users\username\Work\projects\my-project\repo\html`
    - Guest machine IP is __10.0.2.2__ (if this doesn't work, run `route -nee` in the VM and look for the gateway address)

    # Debugging PHP with VSCode and Vagrant

    ## 1. Configure .vscode/launch.json

    ``` 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",
    "pathMappings": {
    "/vagrant/www": "${workspaceFolder}/www/"
    },
    "port": 9000,
    "log": true,
    },
    {
    "name": "Launch currently open script",
    "type": "php",
    "request": "launch",
    "program": "${file}",
    "cwd": "${fileDirname}",
    "port": 9000
    }
    ]
    }
    ```

    ## 2. Configuration
    Note: `${workspaceRoot}` is deprecated, use `${workspaceFolder}`. Also note that the first part of the mapping cannot contain symlinks. Change from `/var/www/html/www` to `/vagrant/www/`

    ### 2.1. Install XDebug
    - If the extension is not currently installed (run `php -i | grep xdebug` in the VM and check the output), follow instructions in [https://xdebug.org/docs/install](https://xdebug.org/docs/install)
    ## 2. Check xdebug.ini

    ### 2.2. Configure XDebug
    Located at `/etc/php/7.0/mods-available/xdebug.ini`

    Check the location of your `php.ini` (in this case located at _/etc/php/7.0/apache2/php.ini_) file and add/change the following configuration:
    Should contain:

    ```
    xdebug.remote_enable = true
    ``` ini
    zend_extension=xdebug.so
    xdebug.remote_enable = 1
    xdebug.remote_connect_back = 1
    xdebug.remote_port = 9000
    xdebug.max_nesting_level = 512
    xdebug.remote_autostart = true
    xdebug.remote_host = 10.0.2.2
    xdebug.remote_port = 9000
    xdebug.remote_log = /var/log/xdebug.log
    xdebug.max_nesting_level = 1000
    ```

    After setting this, remember to restart the webserver: `sudo service apache2 restart`.


    ### 2.3. Install XDebug extension for VSCode
    If you're not sure about the remote.host, execute `route -nee` on the VM and look for the gateway:
    ``` bash
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
    0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 enp0s3 0 0 0
    10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3 0 0 0
    192.168.33.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s8 0 0 0
    ```

    Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension and reload/restart VSCode.
    Or

    ### 2.4. Configure Debugger in VSCode
    ``` bash
    route -nee | awk '{ print $2 }' | sed -n 3p
    10.0.2.2
    ```

    1. Switch to the debugger panel
    2. Click the _gear_ icon at the top and add a PHP configuration.
    3. This will open `./vscode/launch.json` file in the editor. Add an entry with the following settings:
    ```json
    {
    "type": "php",
    "request": "launch",
    "name": "Listen for XDebug",
    "pathMappings": {
    "/var/www/html": "${workspaceRoot}\\html",
    },
    "port": 9000,
    "log": true,
    },
    ```
    Note: I believe `xdebug.remote_host` is added automatically, but double check:

    Be careful setting the path mappings or the debugger will not work. This is critical for the extension to work.
    ``` bash
    $ php -i | grep xdebug.remote_host
    xdebug.remote_host => 10.0.2.2 => 10.0.2.2
    ```

    _NOTE:_ Once you got the debugger working you could set __log__ value to __false__ to avoid displaying the debug console in VSCode.
    Also check that the `xdebug.so` is loaded:

    ``` bash
    $ php -m | grep -i xdebug
    xdebug
    Xdebug
    ```

    ## 2.5. Install an XDebug helper for your browser
    ## 3. Install an XDebug helper for your browser

    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourserlf.

    Here you have some for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/).

    Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the URL to achieve the same but is a little annoying to be adding this manually in each URL you visit.
    Here's one for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper) and one for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/).


    # 3. Debugging
    ## 4. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. __Set a breakpoint__ in the file/line where you want to pause the execution __clicking to the left of the line number in the editor.__ You'll see a _gray_ (unverified) or _red_ (verified) dot.
    3. __Make sure the helper is active__ (usually in green) or add the URL parameter, and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    4. Happy debugging!

    ## 5. Credits


    Heavily isnspired/copied
  12. @sveggiani sveggiani revised this gist Jan 24, 2018. No changes.
  13. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Configure XDebug for Visual Studio Code on a Vagrant VM
    # Configure XDebug, Visual Studio Code for a Vagrant VM

    ## 1. Assumptions

  14. @sveggiani sveggiani revised this gist Jan 24, 2018. No changes.
  15. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,7 @@ Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. __Set a breakpoint__ in the file/line where you want to pause the execution __clicking to the left of the line number in the editor.__ You'll see a _gray_ (unverified) or _red_ (verified) dot.
    3. Make sure the helper is active (usually in green) and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    3. __Make sure the helper is active__ (usually in green) or add the URL parameter, and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    4. Happy debugging!


  16. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -67,9 +67,9 @@ Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the
    # 3. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. Set a breakpoint in the file/line where you want to pause the execution clicking to the left of the line number in the editor. You'll see a __gray__ (unverified) or __red__ (verified) dot.
    3. Make sure the helper is active (usually in green) and load the page/script in which you set the breakpoint.

    2. __Set a breakpoint__ in the file/line where you want to pause the execution __clicking to the left of the line number in the editor.__ You'll see a _gray_ (unverified) or _red_ (verified) dot.
    3. Make sure the helper is active (usually in green) and __load the page/script in which you set the breakpoint__. At this point the page should remain _"loading"_ and the VSCode window become active.
    4. Happy debugging!



  17. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,8 @@ Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbe

    Be careful setting the path mappings or the debugger will not work. This is critical for the extension to work.

    _NOTE:_ Once you got the debugger working you could set __log__ value to __false__ to avoid displaying the debug console in VSCode.


    ## 2.5. Install an XDebug helper for your browser

    @@ -65,7 +67,9 @@ Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the
    # 3. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. Set a breakpoint in the file/line where you want to pause the execution clicking to the left of the line number in the editor. You'll see a gray (unverified) or red (verified) dot.
    3. Make sure the helper
    2. Set a breakpoint in the file/line where you want to pause the execution clicking to the left of the line number in the editor. You'll see a __gray__ (unverified) or __red__ (verified) dot.
    3. Make sure the helper is active (usually in green) and load the page/script in which you set the breakpoint.




  18. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -50,7 +50,7 @@ Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbe
    },
    ```

    Be careful setting the path mappings or the debugger will not work.
    Be careful setting the path mappings or the debugger will not work. This is critical for the extension to work.


    ## 2.5. Install an XDebug helper for your browser
    @@ -66,6 +66,6 @@ Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. Set a breakpoint in the file/line where you want to pause the execution clicking to the left of the line number in the editor. You'll see a gray (unverified) or red (verified) dot.

    3. Make sure the helper


  19. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -62,9 +62,10 @@ Here you have some for [Chrome](https://chrome.google.com/webstore/detail/xdebug
    Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the URL to achieve the same but is a little annoying to be adding this manually in each URL you visit.


    # 3. Debugging

    1. Switch to the Debugger panel and press "Start debugging" button (looks like a green _play_ button at the top). You can also run __Debug: Start debugging__ in the commands pallete.
    2. Set a breakpoint in the file/line where you want to pause the execution clicking to the left of the line number in the editor. You'll see a gray (unverified) or red (verified) dot.



    1. sudo apt-get install php-xdebug
    2. Configure XDebug: http://purencool.com/installing-xdebug-on-ubuntu
    4.
  20. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -57,9 +57,7 @@ Be careful setting the path mappings or the debugger will not work.

    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourserlf.

    Install for:
    - [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper)
    - [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/)
    Here you have some for [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/).

    Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the URL to achieve the same but is a little annoying to be adding this manually in each URL you visit.

  21. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,7 @@ After setting this, remember to restart the webserver: `sudo service apache2 res
    Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension and reload/restart VSCode.

    ### 2.4. Configure Debugger in VSCode

    1. Switch to the debugger panel
    2. Click the _gear_ icon at the top and add a PHP configuration.
    3. This will open `./vscode/launch.json` file in the editor. Add an entry with the following settings:
    @@ -52,6 +53,15 @@ Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbe
    Be careful setting the path mappings or the debugger will not work.


    ## 2.5. Install an XDebug helper for your browser

    These helpers allow to enable or disable Xdebug instead of setting cookies or URL parameters by yourserlf.

    Install for:
    - [Chrome](https://chrome.google.com/webstore/detail/xdebug-helper)
    - [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/)

    Alternatively, you could add the `?XDEBUG_SESSION_START=vscode` parameter to the URL to achieve the same but is a little annoying to be adding this manually in each URL you visit.



  22. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbe
    },
    ```

    Be careful setting the path mappings or
    Be careful setting the path mappings or the debugger will not work.



  23. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 23 additions and 2 deletions.
    25 changes: 23 additions & 2 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    - Guest machine IP is __10.0.2.2__ (if this doesn't work, run `route -nee` in the VM and look for the gateway address)


    ## 2. Instructions
    ## 2. Configuration

    ### 2.1. Install XDebug
    - If the extension is not currently installed (run `php -i | grep xdebug` in the VM and check the output), follow instructions in [https://xdebug.org/docs/install](https://xdebug.org/docs/install)
    @@ -28,10 +28,31 @@ xdebug.max_nesting_level = 1000
    After setting this, remember to restart the webserver: `sudo service apache2 restart`.


    ### 2.3. Install XDebug extension for Visual Studio Code
    ### 2.3. Install XDebug extension for VSCode

    Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension and reload/restart VSCode.

    ### 2.4. Configure Debugger in VSCode
    1. Switch to the debugger panel
    2. Click the _gear_ icon at the top and add a PHP configuration.
    3. This will open `./vscode/launch.json` file in the editor. Add an entry with the following settings:
    ```json
    {
    "type": "php",
    "request": "launch",
    "name": "Listen for XDebug",
    "pathMappings": {
    "/var/www/html": "${workspaceRoot}\\html",
    },
    "port": 9000,
    "log": true,
    },
    ```

    Be careful setting the path mappings or






  24. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@

    ### 2.2. Configure XDebug

    1. Check the location of your `php.ini` (in this case located at _/etc/php/7.0/apache2/php.ini_) file and add/change the following configuration:
    Check the location of your `php.ini` (in this case located at _/etc/php/7.0/apache2/php.ini_) file and add/change the following configuration:

    ```
    xdebug.remote_enable = true
    @@ -25,10 +25,12 @@ xdebug.remote_log = /var/log/xdebug.log
    xdebug.max_nesting_level = 1000
    ```

    2. After setting this, remember to restart the webserver: `sudo service apache2 restart`.
    After setting this, remember to restart the webserver: `sudo service apache2 restart`.


    ### 2. XDebug configuration
    ### 2.3. Install XDebug extension for Visual Studio Code

    Install [PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension and reload/restart VSCode.



  25. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@

    ### 2.2. Configure XDebug

    Check the location of your `php.ini` (in this case located at _/etc/php/7.0/apache2/php.ini_) file and add/change the following configuration:
    1. Check the location of your `php.ini` (in this case located at _/etc/php/7.0/apache2/php.ini_) file and add/change the following configuration:

    ```
    xdebug.remote_enable = true
    @@ -25,7 +25,7 @@ xdebug.remote_log = /var/log/xdebug.log
    xdebug.max_nesting_level = 1000
    ```

    Remember to restart
    2. After setting this, remember to restart the webserver: `sudo service apache2 restart`.


    ### 2. XDebug configuration
  26. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -14,7 +14,7 @@

    ### 2.2. Configure XDebug

    Check the location of your `php.ini` file and add/change the following configuration:
    Check the location of your `php.ini` (in this case located at _/etc/php/7.0/apache2/php.ini_) file and add/change the following configuration:

    ```
    xdebug.remote_enable = true
    @@ -25,6 +25,8 @@ xdebug.remote_log = /var/log/xdebug.log
    xdebug.max_nesting_level = 1000
    ```

    Remember to restart


    ### 2. XDebug configuration

  27. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    - Project (Drupal) is served on `/var/www/html` in the Vagrant box
    - Local project files location: `c:\Users\username\Work\projects\my-project\repo\html`
    - Guest machine IP is __10.0.2.2__ (if this doesn't work, run `route -nee` and look for the gateway address)
    - Guest machine IP is __10.0.2.2__ (if this doesn't work, run `route -nee` in the VM and look for the gateway address)


    ## 2. Instructions
  28. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    - Project (Drupal) is served on `/var/www/html` in the Vagrant box
    - Local project files location: `c:\Users\username\Work\projects\my-project\repo\html`
    - Guest machine IP is __10.0.2.2__ (check Virtual Box properties)
    - Guest machine IP is __10.0.2.2__ (if this doesn't work, run `route -nee` and look for the gateway address)


    ## 2. Instructions
  29. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -4,17 +4,17 @@

    - Project (Drupal) is served on `/var/www/html` in the Vagrant box
    - Local project files location: `c:\Users\username\Work\projects\my-project\repo\html`
    - Guest machine IP is __10.0.2.2__ (check Virtual Box properties)


    ## 2. Instructions

    ### 2.1. Install XDebug
    - If the extension is not currently installed (run `php -i | grep xdebug` in the VM and check the output), follow instructions in [https://xdebug.org/docs/install](https://xdebug.org/docs/install)

    ### 2.2. Configure

    ### 2. XDebug configuration
    ### 2.2. Configure XDebug

    Check the location of your `php.ini` file and add/change the following configuration:

    ```
    xdebug.remote_enable = true
    @@ -26,6 +26,12 @@ xdebug.max_nesting_level = 1000
    ```


    ### 2. XDebug configuration





    1. sudo apt-get install php-xdebug
    2. Configure XDebug: http://purencool.com/installing-xdebug-on-ubuntu
    4.
  30. @sveggiani sveggiani revised this gist Jan 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    ## 2. Instructions

    ### 2.1. Install XDebug
    - If the extension is not currently installed (run `php -i | grep xdebug` and check the output), follow instructions in [https://xdebug.org/docs/install](https://xdebug.org/docs/install)
    - If the extension is not currently installed (run `php -i | grep xdebug` in the VM and check the output), follow instructions in [https://xdebug.org/docs/install](https://xdebug.org/docs/install)

    ### 2.2. Configure