Can't get remote CLI PHP debugging working in one projects, works in another

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://vagrant@dev.project: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://vagrant@dev.project: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.

2 comments
Comment actions Permalink

Ok, figured it out!

In "Settings / Languages & Frameworks / PHP / Interpreter" I had to use "Deployment configuration". Using other settings here don't allow me to provide an appropriate path mapping, at least I couldn't figure it out.

This "deployment" server was configured to use SFTP with the root path set to "/" and have a mapping of "/Users/localuser/src/project/api.project" to "/vagrant/api.project".

I also tried to use the "Vagrant" setting for the remote interpreter but I always got:


However, vagrant definitely works. Maybe it's a problem because the vagrant configuration it outside the the scope of the PhpStorm project, I don't know.

0
Comment actions Permalink

Ok, figured it out!

In "Settings / Languages &  Frameworks / PHP / Interpreter" I had to use "Deployment configuration".  Using other settings here don't allow me to provide an appropriate path  mapping, at least I couldn't figure it out.

This  "deployment" server was configured to use SFTP with the root path set to  "/" and have a mapping of "/Users/localuser/src/project/api.project" to  "/vagrant/api.project".

I also tried to use the "Vagrant" setting for the remote interpreter but I always got:


However,  vagrant definitely works. Maybe it's a problem because the vagrant  configuration it outside the the scope of the PhpStorm project, I don't  know.

0

Please sign in to leave a comment.