Skip to content

Instantly share code, notes, and snippets.

@sheanhoxie
Created February 10, 2020 18:45
Show Gist options
  • Save sheanhoxie/74cffc2e56955bc1419be98d876e270c to your computer and use it in GitHub Desktop.
Save sheanhoxie/74cffc2e56955bc1419be98d876e270c to your computer and use it in GitHub Desktop.
Create a few shell scripts so that you can enable/disable xdebug easily on Mac OSX using Brew
create file
===========
touch xdebug-enable.sh
edit file contents
==================
vim xdebug-enable.sh
# Add the following to the file
sed -i.default "s/^;zend_extension=/zend_extension=/" /usr/local/etc/php/7.2/php.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist
brew services restart php@7.2
echo "xdebug enabled"
add executable permission
=========================
chmod +x xdebug-enable.sh
move file to bin, and remove .sh so we can just type xdebug-enable to enable
============================================================================
mv xdebug-enable.sh /usr/local/bin/xdebug-enable
---------------------------------------------------
repeat almost the same to create the disable script
---------------------------------------------------
create file
===========
touch xdebug-disable.sh
edit file contents
==================
vim xdebug-disable.sh
# Add the following to the file
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.2/php.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php@7.2.plist
brew services restart php@7.2
echo "xdebug disabled"
add executable permission
=========================
chmod +x xdebug-disable.sh
move file to bin, and remove .sh so we can just type xdebug-disable to disable
==============================================================================
mv xdebug-disable.sh /usr/local/bin/xdebug-disable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment