I've it working in one project but not in another.
For some reason the "run configuration" can't figure out the proper mapping of the locally selected script to map to the actual one on the remote machine. What I mean, here's a an example of the run debug output of the working project:
sftp://firstname.lastname@example.org:22/usr/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=172.31.172.1 /vagrant/core.project/some/script.php parameters
Process finished with exit code 0
Here from a project where it doesn't work (they're using the same VM are "next to each other" so to say):
sftp://email@example.com:22/usr/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=172.31.172.1 /Users/localuser/src/project/api.project/vendor/bin/phpunit
Could not open input file: /Users/localuser/src/project/api.project/vendor/bin/phpunit
bash: line 0: cd: /Users/localuser/src/project/api.project/vendor/bin: No such file or directory
Process finished with exit code 1
I know why it fails: the remote path should be /vagrant/api.project/vendor/bin/phpunit and not my local OSX path . For some reason it doesn't "map" it and I don't know why.
In "Settings / Languages & Frameworks / PHP" I've "Interpreter" set to "Remote PHP" and it shows me the proper remote version. When I edit this interpreter it also shows the correct xdebug version.
In "Settings / Languages & Frameworks / PHP / Servers" I've an entry for this project which maps:
/Users/localuser/src/project/api.project -> /vagrant/api.project
I've also set up a deployment configuration (although not sure if it is used/necessary?) in "Settings / Build,Execution,Depoyment / Deployment" using SFTP to the VM "dev.project"; but I don't use deployment because I'm working on the vagrant shared folder.
As far as I can see, for "core.project" and "api.project" I've everwhere the same settings (except the adjusted paths).
Using PhpStorm PS-142.5282
Build #PS-142.5282, built on September 30, 2015
JRE: 1.6.0_65-b14-466.1-11M4716 x86_64
JVM: Java HotSpot(TM) 64-Bit Server VM by Apple Inc.