You can install xdebug with the below command line if pecl is installed
pecl install xdebug
Or follow the similar way in Installing mcrypt to install it yourself. Make sure you change the last step to the below in php.ini
otherwise you may receive this error: Xdebug MUST be loaded as a Zend extension.
To keep php.ini clean, in my installation, I create a new xdebug.ini in /etc/php.d/, the content is as below.
Next configure Eclipse to use xdebug as debugger.
Open Eclipse, go to Window->Preferences, expand PHP->Debug, select XDebug as PHP Debugger.
Under General->Web Browser, you can also choose use external web browser.
Save your changes and close Preferences.
Next go to Run->Debug Configurations. Under PHP Web Application, create a new configuration there. Below are my settings.
You need also configure the default PHP Server to point to your server here.
Now you start to debug your php project with xdebug.