Last active
April 21, 2023 12:04
-
-
Save joshlevinson/93253aec2b41749e10de to your computer and use it in GitHub Desktop.
WP CLI + Xdebug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to /config/bash_profile | |
function wpd { | |
export XDEBUG_CONFIG="idekey=VVVDEBUG remote_connect_back=1" | |
wp "$@" | |
unset XDEBUG_CONFIG | |
}; | |
# Run these commands: | |
# vagrant ssh | |
# sudo cp /srv/config/bash_profile /home/vagrant/.bash_profile | |
# source ~/.bash_profile | |
# Use wpd instead of wp when you want to debug wp-cli commands |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That worked for me, thanks!
If anyone's looking for profiling rather than debugging, this looks like it'd work:
https://daryl.blog/2013/08/14/using-xdebug-with-wp-cli/