-
Notifications
You must be signed in to change notification settings - Fork 4
Debugging with PhpStorm
You can pretty much just follow this: http://blog.elenakolevska.com/debugging-laravel-on-homestead/
-
ssh into homestead vagrant:
$ cd /path/to/ds-homestead $ vagrant ssh
-
Edit 20-xdebug.ini
$ sudo vim /etc/php5/fpm/conf.d/20-xdebug.ini
- Modify the file to:
zend_extension=xdebug.so xdebug.remote_enable = 1 xdebug.remote_connect_back = 1 xdebug.remote_port = 9000
- Modify the file to:
-
Restart php to load the new extension and configurations
$ sudo service php5-fpm restart
-
Settings > Languages & Frameworks > PHP > Interpreter
- Add new Remote...
- Select Vagrant
- For the "Vagrant Instance Folder", set this to your ds-homestead directory
- Test Connection and verify it works
- Get Xdebug Helper for Chrome
- Go to Xdebug Helper options and change IDE key to "PhpStorm"
- and/or add
?XDEBUG_SESSION_START=PHPSTORM
to your http requests
-
In PhpStorm, click Run > Start Listening for PHP Debug Connections
-
When you make a request, there should be a popup from PhpStorm that will automatically add the PHP server and its configurations. The blog post above suggests editing the port number to 8000, but I found that didn't work for me. Leaving it alone at port 80 did however work.
-
You'll also likely need to map the root of your project to the appropriate vagrant folder
-
Go to Settings > Languages & Frameworks > PHP > Servers
-
Select the server for your project
-
Select the root directory of your project and then set the "Absolute path on the server"
ex:
File/Directory:/Users/juy/projects/DS/user-api
Absolute path on server:/home/vagrant/sites/user-api
-