php - How does running an application on a Vagrant instance through PhpStorm work? -
so, i'm trying set breakpoints , code stepping in phpstorm run/debug configuration runs on vagrant/virutalbox instance. however, gaps in understanding how phpstorm integrates vagrant impeding me getting work. follows current theory of how integrating phpstorm vagrant instance works , questions have. if take time correct/expand theory and/or answer questions follow, helpful.
theory: phpstorm can run code in vagrant instance , via ssh tunnel. access vm required breakpoints function because phpstorm needs know server in terms of execution in order know when stall.
q1: can ssh vm clicking "start ssh session" , selecting directory containing vagrantfile. when this, cli vm opens in bottom of ide. need ssh'ed vm in manner in order breakpoints work?
q2: vagrant instance configured run application code on host name via port. still need hit "run" in phpstorm in order code run in such way breakpoints hit? if so, should run/debug config on same port or hostname vagrant instance running on?
thanks input.
i'm not familiar phpstorm "internal" way handle vagrant i've done manually - is: open shell , type vagrant && vagrant ssh
start machine , ssh it.
please refer setting phpstorm vagrant more detailed explanation (took images there), here short version:
- your vagrant machine has running
vagrant up
in folder contains vagrant file
- the vagrant box has configured "deployment configuration" correct path mappings (i advise got sftp deployment)
- you defined remote php interpreter in phpstorm uses deployment configuration
- choose php interpreter http://www.pascallandau.com/img/phpstorm-with-vagrant-using-laravel-homestead-on-windows-10/phpstorm/select-php-interpreter.png
- setup vagrant php interpreter http://www.pascallandau.com/img/phpstorm-with-vagrant-using-laravel-homestead-on-windows-10/phpstorm/interpreter-vagrant-via-deployment.png
Comments
Post a Comment