PHPStorm + XDebug + Vagrant

This question is related to the fact that XDebug works in PHPStorm when a project is executed inside a local virtual machine using Vagrant. I have not found a detailed guide on how to do this so far. Applies to PHPStorm 7.0.

What I would like to touch on in response:

  • How to configure XDebug inside a virtual machine? (Xdebug.ini)
  • Do I need to include any additional ports in the Vagrantfile?
  • How to install a "server" in PHPStorm?
  • How to configure file association when local files are synchronized with NFS in Vagrant VM? Do I need to configure file mapping at all?
  • When you try to "check the remote environment" should you choose the options "FTP", "in place" or "mounted folders"?
  • Do I need to install the extension in a web browser?

I hope this can be useful as a definitive guide to starting XDebug using PHPStorm in Vagrant.

+8
virtual-machine vagrant phpstorm xdebug
source share
1 answer

How to configure XDebug inside a virtual machine? (Xdebug.ini)

This is my zzz_xdebug.ini file:

 xdebug.remote_connect_back = 1 xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_port = 9000 xdebug.idekey = "PHPSTORM" 

Do I need to include any additional ports in the Vagrantfile?

As far as I know,

How to install a "server" in PHPStorm?

I don’t know how I set up this one. Just pointing it to mydomain.dev with the "Xdebug" debugger

How to configure file association when local files are synchronized with NFS in Vagrant VM? Is there a need to configure file associations?

When PHPStorm reaches the breakpoint for the first time, it will request a match. Just select your local folder.

When you try to "check the remote environment" should you select the options "FTP", "in place" or "mounted folders"?

As I set it up, PHPStorm believes that this is the entire local folder (in fact, it is). No FTP, installed folder, shared drive, etc. Just a local project.

Do I need to install the extension in a web browser?

Not an extension, but you can create a bookmarklet to start an xdebug session, see this page to create it.

In addition, in your settings, you must set the “You can accept external connection” parameter to true for Xebug (check the box). To start listening to debugging messages, you must activate it in PHPStorm, see this image .

+6
source share

All Articles