Xdebug is awesome debugging tool for php developers , if you ever developed in php and never used debug then you must give try . its a php extension that will help you a lot .
Setup
just check if /usr/lib/php/extensions/no-debug-non-zts-20121212/
folder is present it means you don’t have to worry about anything just open your php.ini
file /usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
just add at the end of php.ini
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
Or use another method
brew install automake autoconf
git clone https://github.com/derickr/xdebug.git
cd xdebug
phpize
./configure --enable-xdebug
make
cp -r modules/ /usr/local/xdebug
zend_extension= /usr/local/xdebug/xdebug.so