How to setup PHP Xdebug in Mac OSX 10.9 mavericks
As a PHP developer, most of the time when you get an error and want to know detailed information and debug the exact problem, the Xdebug extension comes in handy. In this guide, I’ll show you how to install Xdebug on Mac (10.9 with PHP 5.4).
Note: macOS X Mavericks (10.9) and PHP 5.4 are very outdated. This tutorial is kept for historical reference. For modern macOS and PHP versions, consider using Homebrew to install Xdebug: brew install php-xdebug or use PECL: pecl install xdebug.
My Dev Environment
- Mac OS 10.9.1
- PHP 5.4 ( inbuilt )
- Xcode
clone git repo :
git clone https://github.com/derickr/xdebug.git cd xdebug phpize ./configure --enable-xdebug
make
it will compile and create module directory inside current location
Copy Modules Directory to php extensions directory
cp -r modules/ /usr/local/xdebug
now open your php.ini file , and add this line en the end
zend_extension= /usr/local/xdebug/xdebug.so
then restart webserver
sudo apachectl restart
now create a file with phpinfo() function and see xdebug is listed or not.