6

I'am trying to set up PHPStorm with xdebug. Everyting launches fine, but breakpoints just do not work and have "x" symbol on them.

enter image description here

I'm using openserver with PHP 5.4 and editing files directly on the local web server, so no file mapping is necessary.

I think, that my problem is that web server root is located below the project root directory (for security reasons) and PHPStorm does not that.

Project root: C:\OpenServer\domains\mysite

Web server root (configured in nginx): C:\OpenServer\domains\mysite\httpdocs

How do I tell PHPStorm, that the index.php that webserver runs is actually C:\OpenServer\domains\mysite\httpdocs\index.php, but not C:\OpenServer\domains\mysite\index.php?

Silver Light
  • 44,202
  • 36
  • 123
  • 164
  • Your question is not clear. Are you running Xdebug via HTTP or via CLI? Have you configured the webserver root also within you Phpstorm project? And first of all: What does breakpoints do not work mean? The code does not halt at that point? Have you tried with a point where halting is more obvious? Try that first before digging deeper in. It might be that the debugging sessions just didn't start. – hakre Nov 11 '12 at 09:40
  • Did you resolve this? I am having a similar issue with a project also with a sub directory. My breakpoints hit on index.php but not in other files. (Though they all have the tick symbol displayed). – benedict_w Dec 12 '12 at 21:49
  • I'm also having a similar problem. Breaking on first line functions normally, but setting a breakpoint does absolutely nothing. I can step into all code files, but cannot use breakpoints. After exhausting all other alleys, I've come to the conclusion PHPStorm is choking on the root path (which in my case is in "src" inside the project root). The XDebug logs clearly indicate the correct file path for my path mapping, but the breakpoints do not function. – rich remer Aug 27 '13 at 18:02
  • The X in the breakpoint button is only there to suggest that if you click on it, the breakpoint will be deleted, not that the breakpoint is broken. – Synchro Jan 30 '14 at 09:48

2 Answers2

6

You have to use path mapping. You can find it in debug server configuration Debug server configuration window

Check out official docs and vids:

Ostin
  • 1,511
  • 1
  • 12
  • 25
0

In my case, I tried these steps:

  • step 1: uncheck these two options at xdebug section enter image description here
    • step 2: copy & paste the directory of your project at /xampp/htdocs/{your-project} enter image description here
Omid Erfanmanesh
  • 547
  • 1
  • 7
  • 29