-
-
Save sabid/9b7f7363f3392fce08ff7850e44bbaac to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# | |
# Upgrades or Installs Xdebug on Mac OSX (Tested with Yosemite) YMMV | |
# @author Michael Jett | |
# @requires brew | |
# | |
# curl -kL http://git.io/vBGmR | bash | |
# | |
# Ask for the administrator password upfront | |
sudo -v | |
PHPINI=`php -r "echo php_ini_loaded_file();"` | |
# Remove previous installs of xdebug | |
echo "Checking for previous installs of xdebug and removing them..." | |
brew uninstall $(brew list | grep xdebug) > /dev/null 2>&1 || true | |
brew install automake autoconf gnu-sed --with-default-names | |
git clone https://github.com/derickr/xdebug.git xdebugtmp && cd $_ | |
echo "Building Xdebug..." | |
phpize | |
./configure --enable-xdebug > /dev/null 2>&1 | |
make > /dev/null 2>&1 | |
cp -r modules/ /usr/local/xdebug | |
echo "Cleaning up..." | |
# Cleanup | |
cd .. | |
rm -fr xdebugtmp | |
# Remove previous xdebug config | |
sudo sed -i '/xdebug\.so/d' $PHPINI | |
# Add the new config | |
sudo echo 'zend_extension=/usr/local/xdebug/xdebug.so' >> $PHPINI | |
if [ $? != 0 ] | |
then | |
echo "There were errors installing xdebug." | |
exit 1 | |
fi | |
VER=`php -v | grep -io xdebug[^,]*\,` | |
echo "Successfully Installed $VER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment