Skip to content

Instantly share code, notes, and snippets.

@webflo
Last active October 6, 2016 20:59
Show Gist options
  • Save webflo/0fe113f60acbb91f75ff7908bd138197 to your computer and use it in GitHub Desktop.
Save webflo/0fe113f60acbb91f75ff7908bd138197 to your computer and use it in GitHub Desktop.
MAMP xdebug config
; /Applications/MAMP/bin/php/php7.0.10/conf/ext-xdebug.ini
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php7.0.10/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.max_nesting_level = 3000
#!/bin/bash
# http://github.com/w00fz/xdebug-osx
#
# @author Djamil Legato http://github.com/w00fz/xdebug-osx
# @license MIT
# @version 1.2
app="$(basename $0)"
command="$1"
options="$2"
xdebug_conf_path="/Applications/MAMP/bin/php/php7.0.10/conf/ext-xdebug.ini"
php_default="/Applications/MAMP/bin/php/php7.0.10/conf/php-default.ini"
php_ini="/Applications/MAMP/bin/php/php7.0.10/conf/php.ini"
if [ $? -eq 0 ]; then
STATUS="enabled"
SERVER_NAME="apache"
if [ $# -ge 1 ] && [ "$command" == "on" ] || [ "$command" == "off" ]; then
if [ "$command" == "on" ]; then
cat $php_default $xdebug_conf_path > $php_ini
STATUS="enabled"
elif [ "$command" == "off" ]; then
cat $php_default > $php_ini
STATUS="disabled"
fi
echo ""
echo "Xdebug has been $STATUS, restarting $SERVER_NAME (it might ask for your password)"
sudo pkill -9 httpd
sudo /Applications/MAMP/Library/bin/apachectl -k restart > /dev/null 2>&1
else
echo ""
echo "Usage: ${app} <on | off> [--no-server-restart]"
fi
echo ""
echo "You are running PHP with Xdebug $STATUS"
echo ""
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment