Reputation: 2006
I have a problem to install xdebug on my Ubuntu Server which is using xampp. I know in Stack Overflow there are several questions about this kind of problem but I did not find any solution.
First this is the output of php --version
command:
PHP 5.3.8 (cli) (built: Sep 19 2011 13:29:27)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
Output of php --ini
command:
Configuration File (php.ini) Path: /opt/lampp/etc
Loaded Configuration File: /opt/lampp/etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
Output of php -m
command:
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
intl
json
ldap
libxml
mbstring
mcrypt
memcache
mhash
ming
mssql
mysql
mysqli
mysqlnd
ncurses
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
radius
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
SQLite
sqlite3
standard
sybase_ct
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
xsl
zip
zlib
[Zend Modules]
xdebug
When I paste the output of phpinfo()
in http://xdebug.org/wizard.php
, the site shows the following:
But here are the instructions anyway:
... ... ... (lines truncated) ... ... ...
I write this on my /opt/lampp/etc/php.ini
at the bottom:
[xdebug]
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
xdebug.profiler_output_dir = "/tmp/xdebug"
xdebug.profiler_enable = On
xdebug.remote_enable = On
xdebug.remote_host = "localhost"
xdebug.remote_port = 10000
xdebug.remote_handler = "dbgp"
Output of phpunit --version
is as follows:
PHPUnit 3.6.11 by Sebastian Bergmann.
Now my actual problem arises:
When I use the following command it shows that xdebug is not installed:
phpunit --coverage-html ~/build/logs/coverage
This command's output is as follows:
The Xdebug extension is not loaded. No code coverage will be generated.
Upvotes: 15
Views: 20611
Reputation: 10221
Not sure if it helps but...
I had the same error when going through the phpunit tutorial - getting the error at chapter 7. http://phpunit.de/manual/current/en/organizing-tests.html
Took me a while to realise xdebug was set up in /etc/php5/apache2/php.ini but not in /etc/php5/cli/php.ini.
Worked okay for me after copying the xdebug settings from apache2 to cli.
Upvotes: 12
Reputation: 33
See your "php.ini" in the folder "cli" on php5, this not have the lines references for your xdebug. So, add the lines for xdebug.
Upvotes: 1
Reputation: 36794
It is possible that phpunit uses a different PHP version from the one that you have installed Xdebug for. Try to use php `which phpunit` --coverage-html ~/build/logs/coverage
, if that works, then phpunit uses the wrong PHP by default. This could be a path issue.
Upvotes: 7