Remote debugging PHP with a firewall in the way

If you unable to connect IDE to xdebug, probably there is a firewall between your IDE and xdebug. You can either set up a tunnel or disable your firewall. Here is how you can disable firewall in ubuntu:

sudo ufw disable



PHP Profiler

  1. sudo apt-get install python-setuptools
  2. sudo easy_install xdebugtoolkit
  3. sudo apt-get install graphviz
  4. sudo apt-get install php5-xdebug
  5. [xdebug]
  6. Add a trigger to a page you want to profiling
  7. cg2dot /tmp/cachegrind.out.7340 | dot -Tpng -o ~/xdebug-all.png

Fix Waiting For Connection (netbeans-xdebug) in Netbeans

  1. This is the old and buggy xdebug config: [Xdebug] ;zend_extension=/usr/lib/php5/20121212/ ;xdebug.remote_host= xdebug.remote_connect_back=1 xdebug.remote_enable=1 xdebug.remote_autostart = 1 xdebug.remote_handler=”dbgp” xdebug.remote_port=9000 xdebug.profiler_enable=0 xdebug.profiler_enable_trigger = 1
  2. This is new and stable xdebug config: [xdebug] ;zend_extension=/usr/lib/php5/20121212/ xdebug.remote_host= xdebug.remote_enable=1 xdebug.remote_autostart = 1 xdebug.default_enable = 1 xdebug.remote_handler=dbgp xdebug.remote_port=9000 xdebug.idekey=”netbeans-xdebug” xdebug.profiler_enable=1 xdebug.profiler_enable_trigger = 1
  3. sudo vim /etc/php5/apache2/php.ini
  4. Change to new config
  5. sudo vim /etc/php5/cli/php.ini
  6. Change to new config
  7. sudo service apache2 restart
  8. Disable ‘Watches and Balloon Evaluation’ in netbeans
  9. Restart netbeans