I'm using PhpStorm on OSX (latest version of both, but that doesn't matter). Due to circumstances beyond my control, the project is located under /var/projects/
- which, intrinsically, OSX converts to /private/var/projects/
. My autoloader uses __DIR__
construct to determine the base location of the classes - and this resolves to /private/var/projects/myproject/specific/path/autoloader.php
. Consequently, classes are being loaded with paths /private/var/projects/myproject/path/to/file/class.php
.
As a result, I can't debug them in CLI mode, because the file being loaded is different from the file in the project (i.e. the file in the project doesn't have /private
in the path) and PhpStorm ignores breakpoints.
Is there any way to tell PhpStorm that /private/var/projects
is mapped to /var/projects
- for CLI applications?
If not, what else can I do other than actually opening the project from /private/var/projects/myproject
?
Unfortunately, there seems to be no solution that allows to keep the files where they are. I created another root directory /opt
and moved projects there. Now my structure is /opt/projects/myproject
and everything works as expected.