Without installing a texteditor or an IDE, is it possible to test if xdebug is working, i.e. if it can debug php code?
The only part xdebug comes up in phpinfo() is
Run
php -m -c
in your terminal, and then look for [Zend Modules]
. It should be somewhere there if it is loaded!
NB
If you're using Ubuntu, it may not show up here because you need to add the xdebug settings from /etc/php5/apache2/php.ini
into /etc/php5/cli/php.ini
. Mine are
[xdebug]
zend_extension = /usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
If you are using Eclipse then please note that while running on XDebug mode the magic constant __FILE__ will always be evaluated to:
xdebug://debug-eval
So the following check will return true if your session is under XDebug:
$is_xdebug = false !== strpos(__FILE__,'xdebug'); // true while on XDebug