Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP CLI + Xdebug
# 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
@iandunn

This comment has been minimized.

Copy link

@iandunn iandunn commented Jun 10, 2020

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/

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