Skip to content

Instantly share code, notes, and snippets.

@roma-glushko
Created May 31, 2018 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roma-glushko/055303648fa2efcfd8f01481a303b3b2 to your computer and use it in GitHub Desktop.
Save roma-glushko/055303648fa2efcfd8f01481a303b3b2 to your computer and use it in GitHub Desktop.
A bash script to toggle xdebug module
#!/bin/env bash
# Simple script to enable or disable the xdebug extension
case $1 in
on)
sudo sudo phpenmod xdebug
sudo service apache2 restart
echo "Xdebug is ON"
;;
off)
sudo sudo phpdismod xdebug
sudo service apache2 restart
echo "Xdebug is OFF"
;;
*)
if [ -f /etc/php/7.0/mods-available/xdebug.ini ]; then
. ~/scripts/xdebug.bash off
else
. ~/scripts/xdebug.bash on
fi
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment