It was bugging me (debugging me?) that Xdebug profiling dragged my development server down so much. So here’s a simple script to place in /usr/local/bin to turn it off and on more easily. Remember to chmod +x it first.
This works fine on Ubuntu.
#!/bin/bash # Simple script to enable or disable xdebug profiling case $1 in on) sudo sed -i 's/xdebug.profiler_enable=0/xdebug.profiler_enable=1/g' /etc/php5/conf.d/xdebug.ini sudo service apache2 restart ;; off) sudo sed -i 's/xdebug.profiler_enable=1/xdebug.profiler_enable=0/g' /etc/php5/conf.d/xdebug.ini sudo service apache2 restart ;; *) echo "Usage: php_debug on|off" ;; esac
0 Comments.