Each machine that has Apple's XCode installed has also XDebug, so we don't need to add it with pecl, brew, macports, or any similar package manager, simply add it to your php.ini
file!
To simply do it, I give you this one-liner solution:
sudo sh -c 'echo zend_extension=$(find /usr/lib/php/extensions -name "xdebug.so") >> $(php -qr "echo php_ini_loaded_file();") && apachectl restart'
If you're familiar with bash you probably have already understood, but if you need extra info about what's happening (and you should) there's the explaination:
- Find the native Xdebug extension that comes with Xcode:
find /usr/lib/php/extensions -name "xdebug.so"
- Asks php which config file is loaded:
php -qr "echo php_ini_loaded_file();"
- Adds the Xdebug extension path in the config file (echived using
echo
and>>
) - Restarts apache.
apachectl restart
source: http://stackoverflow.com/questions/19579401/php-xdebug-on-os-x-10-9-mavericks
Note: Additional
*.ini
files are usually loaded by apache from this directory:/Library/Server/Web/Config/php