How to setup PHP Xdebug in Mac OSX 10.9 mavericks

1 min read
PageLines- Xdebug-logo.png
PageLines- Xdebug-logo.png

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

  1. Mac OS 10.9.1
  2. PHP 5.4 ( inbuilt )
  3. 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.

Screen Shot 2014-01-07 at 12.06.13 pm
Screen Shot 2014-01-07 at 12.06.13 pm
Screen Shot 2014-01-07 at 12.09.46 pm
Screen Shot 2014-01-07 at 12.09.46 pm



  • Home
  • About