Xdebug is a must have extension for PHP, although the times you don't actually need it, it's a drag.
This simple script allows to toggle on
and off
Xdebug and is meant for anyone running PHP
and Xdebug
installed via Homebrew.
You can follow the OS X Apache Setup guide, divided in two parts, to get the perfect MAMP setup on OSX:
This script is inspired by the great sphp script. Which I highly suggest to install if you need to switch easily between php versions
curl -L https://raw.githubusercontent.com/w00fz/xdebug-osx/master/xdebug > /usr/local/bin/xdebug
git clone git@github.com:w00fz/xdebug-osx.git
Add /usr/local/bin
to your $PATH
. If you use the Bash shell, you can do this by running this command:
echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bashrc
You may need to restart your shell for this to take effect, or refrehs it with source ~/.bashrc
.
If you want the global command then run:
cd xdebug-osx
ln -s `pwd`/xdebug /usr/local/bin/xdebug
./xdebug-osx/xdebug # outputs the current status
./xdebug-osx/xdebug on # enables xdebug
./xdebug-osx/xdebug off # disables xdebug