Last active
September 12, 2017 08:24
-
-
Save molotovbliss/1afcf9b3cf3af1b6fcc6bc7ae1e34bc9 to your computer and use it in GitHub Desktop.
PHP 7.0 Easy bash xdebug toggle for Magento 2.x development
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
#!/bin/bash | |
# Simple script to enable or disable the xdebug extension | |
# Save to ~/bin/xdebug and chmod +x ~/bin/xdebug | |
# original source: https://gist.github.com/jeromegamez/0ae5bce4209cf9ae680e | |
case $1 in | |
on) | |
[ -f /etc/php/7.0/mods-available/xdebug.ini.deactivated ] && sudo mv /etc/php/7.0/mods-available/xdebug.ini.deactivated /etc/php/7.0/mods-available/xdebug.ini | |
sudo service php7.0-fpm restart | |
sudo service apache2 restart | |
echo "PHP7.0 Xdebug is ON" | |
;; | |
off) | |
[ -f /etc/php/7.0/mods-available/xdebug.ini ] && sudo mv /etc/php/7.0/mods-available/xdebug.ini /etc/php/7.0/mods-available/xdebug.ini.deactivated | |
sudo service php7.0-fpm restart | |
sudo service apache2 restart | |
echo "PHP7.0 Xdebug is OFF" | |
;; | |
*) | |
if [ -f /etc/php/7.0/mods-available/xdebug.ini ]; then | |
. ~/bin/xdebug off | |
else | |
. ~/bin/xdebug on | |
fi | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment