Debugger automagically resolving symlinks
Hello, I am having problems with PHPstorm resolving symlinks when path mapping between a remote server and the local files.
I have a website www.foobar.com resolves via a symlink:
/usr/local/www/data/website/live-deployment/ => /usr/local/www/data/website/deployments/website/releases/20171011163721/public/blah.....
Every time I deploy the real path to the files change and the symlink remains constant.
Due to PHPstorm resolving the files to the absolute path I have to adjust the server path mapping in the after each deploy.
When I used eclipse PDT I don't encounter this issue, so therefore assume that it's PHPStorm that is resolving the symlink.
It would be really handy of there was a checkbox in the server config under "Use Path mappings" for "Resolve symlinks" so that I could uncheck it and not have to fiddle around with the paths on each deploy.
If this was an option the debugger would always look for files using /usr/local/www/data/website/live-deployment/ and I would just need to setup the path mapping for this symlink once.
Keith.
请先登录再写评论。
Hi there,
PhpStorm does not resolve any symlinks like that.
PhpStorm works with any symlinks as is .. while xdebug (or perhaps PHP itself) works with final/resolved paths.
You have mentioned deployment ... so I assume that debugging happens on some remote server right? How do you deploy then? Does that deployment path is known to IDE (e.g. you are using built-in Deployment functionality so IDE knows that when you change some "/PROJECT_ROOT/file.php" it will be uploaded to "/PROJECT_ROOT/some/path/timestamp/file.php")? Plus, FTP (and possibly SFTP) do not tell if that specific file/folder is ordinary file or a symlinked one.
Based on your description so far I do not see how this IDE can guess the right path for debugging mapping.
To clarify, were using Zend Debugger on a remote server.
The files are transferred via a custom script that SSH the files to a dated release folder,
To avoid having to change the apache settings the web root is pointing to a symlink which points to the latest release.
This issue is, that after each time the files are deployed into a newly dated release folder, I have to remap things in PHPStorm.
The local files I edit are not symlinked.
When I used eclipse I didn't have to repam after each deployment as the path mapping worked it out. I assumed that PHPStorm was resolving symlinks, perhaps the case is the PDT/Zend is just a bit more intelligent about resolving the path mappings.
Looks like https://youtrack.jetbrains.com/issue/WI-600.
Please vote for it (thumb up button) in order to move it up in the queue and receive notifications regarding the progress of the feature. See more information on working with tracker at <https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications>.
Indeed it does look like that 8 year old issue resurfacing. I assume it's a TDWF (Too difficult won't fix) issue?
We're using https://github.com/deployphp/deployer with variable-dated folders symlinked to `current/`, and I think we're hitting the exact same problem now - we're path mapping to a symlinked target, which doesn't get matched by the debugger.
Getting the exact same issue as Leho at the moment. Workaround as of https://youtrack.jetbrains.com/issue/WI-600 is to change the path mapping to the resolved directory each deploy (could setup a custom "modify my IDE settings" task using deploy, until this is resolved)
So instead of it mapping to `/var/www/html/current/` you would map to `/var/www/html/releases/123` and then on redeploy, change the mapping in the IDE to `/var/www/html/releases/456` etc.
Hope that at least shows the problem in a better light