Xdebug is a PHP debugger with nice Eclipse integration. Here are some instructions for installing it (assuming you already have Apache 2 and PHP 5).
This article explains in more detail, but isn't Ubuntu-specific. It does detail Eclipse configuration for Xdebug in detail, though.
You need to be root to do the installation.
First off, install Xdebug. This isn't packaged for Ubuntu, so you need to do it with PECL. So install PECL if you don't have it:
apt-get install pecl
Use PECL to install Xdebug:
pecl install xdebug
Configure PHP 5 to use Xdebug by adding these lines to /etc/php5/apache2/php.ini (somewhere near where the other extension= lines are):
zend_extension=/usr/lib/php5/20060613+lfs/xdebug.so
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=127.0.0.1
xdebug.remote_log=/var/log/apache2/xdebug_remote.log
Note you need to use zend_extension= to load the extension, and you should use the absolute path to the module (.so file) to do this. Otherwise it fails.
Check using PHP info, e.g. add a file called phpinfo.php to your web root:
<?php phpinfo(); ?>
Then call it in your browser. Check that there is an Xdebug section displayed.
That's Xdebug installed. See the article linked at the start of this entry if you want to integrate with Eclipse.
浙公网安备 33010602011771号