Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
move xdebug into seperate markdown
Browse files Browse the repository at this point in the history
Signed-off-by: Jason McCallister <[email protected]>
  • Loading branch information
jasonmccallister committed Apr 16, 2020
1 parent 7ced0d3 commit 0566ca8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 50 deletions.
50 changes: 0 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,53 +333,3 @@ This displays nginx logs for the `diesel` machine:
```bash
nitro logs
```

#### Debugging web requests

Once you have a machine created, you can run `nitro xdebug on` to enable Xdebug
support in your machine.

Install the Xdebug browser helper in your favorite browser.

* [Chrome](https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc)

* [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/)

* [Internet Explorer](https://www.jetbrains.com/phpstorm/marklets/)

* [Safari](https://github.com/benmatselby/xdebug-toggler)

* [Opera](https://addons.opera.com/addons/extensions/details/xdebug-launcher/)

Go to the Xdebug browser helper options, choose "PhpStorm" and save.

![Xdebug Browser Helper Chrome](resources/xdebug_chrome_settings.png)

Create a new server in PhpStorm using your machine's domain name.
![PhpStorm Server Settings](resources/phpstorm_server.png)
Setup path mappings to that `/app/sites/example.test` in your Nitro machine is
mapped to your project's root on your host machine.

Create a new "PHP Remote Debug" configuration and select the server you just created.

Check "Filter debug connection by IDE key" and enter "PHPSTORM" for the IDE key.

![PhpStorm Remote Debug Settings](resources/phpstorm_remote_debug.png)

Click the "Start Listening for PHP Debug Connections" button in PhpStorm.

![PhpStorm Remote Debug Settings](resources/start_listening.png)

Click the "Debug" button on your browser's Xdebug helper.
![PhpStorm Remote Debug Settings](resources/xdebug_chrome.png)
Then load the site in your browser and whatever breakpoints you've set will be hit.

#### Debugging PHP console requests

Do everything above except Xdebug browser helper. SSH into your Nitro machine using
`nitro ssh`, then run your PHP script from the console and any breakpoints you've
set will be hit.
46 changes: 46 additions & 0 deletions XDEBUG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Using Xdebug with Nitro and PHPStorm

Once you have a machine created, you can run `nitro xdebug on` and `nitro xdebug configure` to enable Xdebug and set it up for automatic remote connections from your host machine. These make the

## Debugging web requests

Install the Xdebug browser helper in your favorite browser.

- [Chrome](https://chrome.google.com/extensions/detail/eadndfjplgieldjbigjakmdgkmoaaaoc)
- [Firefox](https://addons.mozilla.org/en-US/firefox/addon/xdebug-helper-for-firefox/)
- [Internet Explorer](https://www.jetbrains.com/phpstorm/marklets/)
- [Safari](https://github.com/benmatselby/xdebug-toggler)
- [Opera](https://addons.opera.com/addons/extensions/details/xdebug-launcher/)

Go to the Xdebug browser helper options, choose "PhpStorm" and save.

![Xdebug Browser Helper Chrome](resources/xdebug_chrome_settings.png)

Create a new server in PhpStorm using your machine's domain name.

![PhpStorm Server Settings](resources/phpstorm_server.png)

Setup path mappings to that `/app/sites/example.test` in your Nitro machine is
mapped to your project's root on your host machine.

Create a new "PHP Remote Debug" configuration and select the server you just created.

Check "Filter debug connection by IDE key" and enter "PHPSTORM" for the IDE key.

![PhpStorm Remote Debug Settings](resources/phpstorm_remote_debug.png)

Click the "Start Listening for PHP Debug Connections" button in PhpStorm.

![PhpStorm Remote Debug Settings](resources/start_listening.png)

Click the "Debug" button on your browser's Xdebug helper.

![PhpStorm Remote Debug Settings](resources/xdebug_chrome.png)

Then load the site in your browser and whatever breakpoints you've set will be hit.

## Debugging PHP console requests

Do everything above except Xdebug browser helper. SSH into your Nitro machine using
`nitro ssh`, then run your PHP script from the console and any breakpoints you've
set will be hit.

0 comments on commit 0566ca8

Please sign in to comment.