Skip to content

Instantly share code, notes, and snippets.

@nWidart
Created March 31, 2015 06:57
Show Gist options
  • Save nWidart/a587cc6f91fcca59c530 to your computer and use it in GitHub Desktop.
Save nWidart/a587cc6f91fcca59c530 to your computer and use it in GitHub Desktop.

Setting up Xdebug on Mac OS using MAMP

Find the loaded configuration file

$ php --ini

Edit the loaded configuration file

$ vim {Path/To/Loaded/Configuration/File.ini}

Add where [xdebug] is defined:

[xdebug]
zend_extension="/Applications/MAMP/bin/php/php{phpversion}/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "/tmp"

;extension="memcached.so"
xdebug.max_nesting_level = 200

Edit php config file template

Mamp > Edit Template > PHP > {PHP Version}

At the bottom, for the [xdebug] area:

 zend_extension="/Applications/MAMP/bin/php{version}/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
 xdebug.remote_enable=1
 xdebug.remote_host=localhost
 xdebug.remote_port=9000
 xdebug.remote_autostart=1
 xdebug.var_display_max_children=-1
 xdebug.var_display_max_data=-1
 xdebug.var_display_max_depth=-1
 ;xdebug.profiler_enable=0
 ;xdebug.profiler_output_dir="/Applications/MAMP/tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment