Contents
  1. 1. Download xdebug
  2. 2. Install XDebug
  3. 3. Paste the following code to php.ini
  4. 4. Follow the this link to enable xdebug on phpstorm:

I’ve seen quite a lot of PHP developers don’t have PHP debugger installed on development enviornment. Instead of debugging PHP code line by line, we’re fond of echo and print the results on the web page to find the errors.

It would be hard in the past because we don’t have good PHP IDE until we have PHPStorm. Unfortunately PHPStorm doesn’t have debugger installed in the environment and we have to install it by ourselves.

Download xdebug

1
git clone git://github.com/xdebug/xdebug.git

Install XDebug

1
2
3
4
5
cd xdebug
phpize
sudo ./configure –enable-xdebug
sudo make
sudo make install

NOTE: After the installation, it will output the path of debug.so from the command line. Save it and paste into zend_extension to the configuration setting in next step.

Paste the following code to php.ini

1
2
3
4
5
6
7
zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.idekey=PHPSTORM
xdebug.remote_port=9000
xdebug.remote_log=/var/log/xdebug.log

https://confluence.jetbrains.com/display/PhpStorm/Remote+debugging+in+PhpStorm+via+SSH+tunnel

Contents
  1. 1. Download xdebug
  2. 2. Install XDebug
  3. 3. Paste the following code to php.ini
  4. 4. Follow the this link to enable xdebug on phpstorm: