Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Wilby1976's avatar

PHPUnit Testing - XDebug: invalid ELF header in PHPStorm

I've recently started doing Unit Tests using PHPUnit which I absolutely love! The issue is that I'd like to be able to use xdebug while doing these tests to debug the issues I encounter and I get the following error:

vagrant:///Users/christopherwilbraham/ubuntu_xenial64/usr/bin/php /var/www/html/intranet/vendor/phpunit/phpunit/phpunit --no-configuration --filter /TestHolidayDateCheck::testHolidayDates$/ /var/www/html/intranet/PHPUnitTests/TestHolidayDateCheck.php --teamcity

Testing started at 11:18 AM ...

Failed loading /etc/php/7.0/mods-available/xdebug.ini: /etc/php/7.0/mods-available/xdebug.ini: invalid ELF header

PHPUnit 6.3.0 by Sebastian Bergmann and contributors.

Thanks in advance for the help!

Chris

0 likes
3 replies
phpMick's avatar

I would also like to be able to do this but have never tried. The debug messages from PHPUnit are pretty cryptic.

Mick

phpMick's avatar

Got mine working as well.

I think I had a remote plugin disabled.

Breakpoints in tests, brilliant!

Please or to participate in this conversation.