Using symbolic links on Windows

PHPStorm 5.0.4

My file structure on Windows:

\parent
     \core
          \includes
          \sites (*symlink to ..\sites)
     \sites

When the PHPStorm root (where .idea folder is created) is set to "\core", then debugging just doesn't work at all for breakpoints set in files in \sites folder.

When the root is set to "\parent", then IDE complains about multiple declarations and has problems with completion, member resolution and inheritance analysis of classes.

So, it doesn't work well either way.

2 comments
Comment actions Permalink

Hi there,

When the root is set to "\parent", then IDE complains about multiple declarations and has problems with completion

Correct. That's why you should exclude duplicated folder from the project (that's how IDE works ATM, unfortunately -- it does not handle multiple copies of the same file well)

When the PHPStorm root (where .idea folder is created) is set to "\core", then debugging just doesn't work at all for breakpoints set in files in \sites folder.

Everythig works fine (I'm using debugger & symlinks with no problems) -- you just need to configure it a tiny bit

  • Settings | PHP | Servers
  • you need to tick "Use path mappings" (description next to it says why would you need it)
  • and provide REAL path (on right side) for symlinked folder


It is required because debugger (xdebug in particular) works with resolved/final paths ONLY -- that is the path xdebug reports to IDE when debugging .. and IDE needs to know how to translate such path into project files path (since technically "parent\sites" is outside of the project).

0
Comment actions Permalink

Thanks! I think I got it working. After adding mapping for the "\sites" folder, it became necessary to add mapping also for the root "\core" folder (otherwise the debugger didn't stop at breakpoints set outside the mapped "\sites" folder). But now it seems everything is working.

0

Please sign in to leave a comment.