Skip to content

Instantly share code, notes, and snippets.

@delphian
Created September 7, 2013 01:52
Show Gist options
  • Save delphian/6472109 to your computer and use it in GitHub Desktop.
Save delphian/6472109 to your computer and use it in GitHub Desktop.
Configure Intellij to debug php scripts running on a virtual machine using xdebug
# Configure intellij by adding new PHP Server
IntelliJ IDEA -> Preferences -> PHP -> Servers
# Configure Intellij by adding new Run/Debug Configuration
Add new 'PHP Web Application' and select the server name created above.
# Run from host to forward 9000 out of virtual machine back to host listener.
ssh -p 2222 [email protected] -R 9000:localhost:9000
# Edit xdebug configuration in virtual machine
sudo vi /etc/php5/conf.d/20-xdebug.ini
# Add lines:
xdebug.remote_enable = On
xdebug.remote_connect_back = On
xdebug.remote_log = /tmp/xdebug.log
# Restart apache in virtual machine
sudo apachectl restart
# Verify apache is listening to 80
sudo netstat -plnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment