Skip to content

Instantly share code, notes, and snippets.

@tpkemme
Created December 11, 2017 19:39
Show Gist options
  • Save tpkemme/323c338a973d3de75b12db430d65502f to your computer and use it in GitHub Desktop.
Save tpkemme/323c338a973d3de75b12db430d65502f to your computer and use it in GitHub Desktop.
Setup Xdebug on Mac with PHPStorm
# 1. Access box via ssh
vagrant ssh
# 2. Update packages and make sure debug is install
sudo apt-get update
sudo apt-get install php-xdebug
# 3. Open Xdebug Config File
sudo nano /etc/php/7.0/apache2/conf.d/20-xdebug.ini
# 4. Add the following to the config file above
# Remote host = vagrant box IP
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_host=192.168.35.67
# 5. Restart Apache
sudo service apache2 restart
# 6. Verify XDebug is running
php --version
# 7. Run Web Server Debug Validation
Run >> "Web Server Debug and Validation"
# 8. Validate Web Server Debug (only available in PHPSTORM)
# Host = IP address to site
SFTP host: 192.168.35.67
Port: 22
Root path: /srv/www.t-3.com
Username: ubuntu
# Need to change password manually if it is not set
Password: ubuntu
# Browse files on server
Web server root URL: https://www.t-3.build
# 9. Verify Xdebug port and that it can accept external connections in IDE
Debug port: 9000
# 10. Add debug server to IDE
Name: T3 Debug Server
Host: 192.168.35.67
Port: 80
Debugger: Xdebug
Check "Use Path Mappings"
# 11. Connect Xdebug server to Web server
Run >> "Edit Configurations"
Server: T3 Debug Server # From pervious step
# 12. Enable listening for PHP Connections
Run >> "Start Listening for PHP Debug Connections"
# 13. Start Xdebug chrome extension (https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en)
IDE key: PHPSTORM
Debug: Enable
@tpkemme
Copy link
Author

tpkemme commented Dec 11, 2017

Not an actual bash script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment