Installing xdebug 2.1

Hey,

Anyone else have an issue using xdebug from the command line?


$ sudo pecl install xdebug

Installation goes ok:

Installing ‘/usr/lib/php5/20090626/xdebug.so’
install ok: channel://pecl.php.net/xdebug-2.1.0

Then trying to find where it was installed returns no standard output


$ which xdebug

I added the extension in php.ini file


[xdebug]
zend_extension = /usr/lib/php5/20090626/xdebug.so

After a quick restart I can tell that it’s running fine, because the phpinfo() shows xdebug extension and running a var_dump shows additional information.

Anyone know where I went wrong?

So if phpinfo shows that it’s installed, then what’s the problem?

The problem is that I cannot use xdebug through the command line.

When I try to use php unit it causes even more errors:


$ phpunit --coverage-html .

It says that xdebug is not installed.

Maybe there are 2 different versions of php installed - one for command line and another for web? Is that possible?

Not only possible, but that’s usually the case.

proxi, does running php -m mention Xdebug in the output? If not, then make sure that the extension is being enabled in the php.ini file being used by CLI (you can do php --ini to find which ini files are being used).

aha! Thanks Salathe. I got it working now.