Skip to content

Instantly share code, notes, and snippets.

@kibao
Last active December 20, 2015 20:39
Show Gist options
  • Save kibao/6192063 to your computer and use it in GitHub Desktop.
Save kibao/6192063 to your computer and use it in GitHub Desktop.
Toogle xdebug command.

Install

cd /usr/bin/local
sudo wget https://gist.github.com/kibao/6192063/raw/529ca3eccda769b3111db42fb28eb4993482875b/xdebug-toggle
sudo chmod +x xdebug-toggle

Usage

sudo xdebug-toggle

#!/bin/bash
XDEBUG_CONF_FILE="/etc/php5/conf.d/20-xdebug.ini"
if [ $EUID != 0 ]; then
echo "[ERROR] You must be superuser"
echo
exit 1
fi
if [ -L $XDEBUG_CONF_FILE ]; then
echo "Disabling xdebug"
php5dismod xdebug
else
echo "Enabling xdebug"
php5enmod xdebug
fi
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment