Last active
March 28, 2017 15:17
-
-
Save MagePsycho/e6e6f4ee532bbea37c7f31ea160b264c to your computer and use it in GitHub Desktop.
Toggle PHP XDebug in Ubuntu
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
phpToggleXdebug() { | |
case $1 in | |
on) | |
[ -f /etc/php5/mods-available/xdebug.ini.deactivated ] && sudo mv /etc/php5/mods-available/xdebug.ini.deactivated /etc/php5/mods-available/xdebug.ini | |
sudo service php5-fpm restart | |
sudo service nginx restart | |
;; | |
off) | |
[ -f /etc/php5/mods-available/xdebug.ini ] && sudo mv /etc/php5/mods-available/xdebug.ini /etc/php5/mods-available/xdebug.ini.deactivated | |
sudo service php5-fpm restart | |
sudo service nginx restart | |
;; | |
status) | |
php -m | grep xdebug | |
;; | |
*) | |
echo "Usage: php:debug on|off|status" | |
;; | |
esac | |
} | |
alias php:debug="phpToggleXdebug" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment