Summer Sale! All accounts are 50% off this week.

macedorjd's avatar

PHPUnit Segmentation Fault on Homestead

Hi there,

I'm having a trouble when running my tests on PHPStorm using phpunit because always gets a Segmentation Fault.

In the example below I'm running my Test Suite, but this still happens with a single test.

With php 7.1

PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

bash: line 1:  3244 Segmentation fault (core dumped) 
env "JETBRAINS_REMOTE_RUN"="1" "IDE_PHPUNIT_CUSTOM_LOADER"="/home/vagrant/code/app/vendor/autoload.php" /usr/bin/php7.1 /home/vagrant/code/app/vendor/phpunit/phpunit/phpunit -d zend.enable_gc=0 --configuration /home/vagrant/code/app/phpunit.xml /home/vagrant/code/app/tests --teamcity

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

With php 7.2

PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

bash: line 1:  3291 Segmentation fault (core dumped) 
env "JETBRAINS_REMOTE_RUN"="1" "IDE_PHPUNIT_CUSTOM_LOADER"="/home/vagrant/code/wine-and-vine/vendor/autoload.php" /usr/bin/php /home/vagrant/code/wine-and-vine/vendor/phpunit/phpunit/phpunit -d zend.enable_gc=0 --configuration /home/vagrant/code/wine-and-vine/phpunit.xml /home/vagrant/code/wine-and-vine/tests --teamcity

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

I've even removed the Test Runner Option and gives me the same error

-d zend.enable_gc=0  

Has anything like this happened to any of you guys?

Thanks in advance!

0 likes
6 replies
ejdelmonico's avatar

I personally have not had a problem with Phpstorm running tests but I know of an issue dating back a few years that is similar to yours. You can try:

In PhpStorm > Run > Edit Configurations, for Test Runner options:
-d zend.enable_gc=0
2 likes
macedorjd's avatar

Hi @ejdelmonico ,

I've already tried that option. With or without it, it just doesn't work...

The weird thing is that I was doing TDD and everything was fine...

Can this be anything related to xDebug?

I've seen some older posts online talking that.

ejdelmonico's avatar

Actually, yes...I have had many issues using xdebug with Phpstorm. If I have an issue where I need xdebug, I use VSCode with xdebug setup per the Tightenco blog article. I was tired of chasing down issues with using it in Phpstorm even though I love there IDE's. I do know that the config file for xdebug to work with xdebug has to a certain way to work consistently. ext-xdebug.ini

impbob36's avatar

@macedorjd - yeah, thats the blog he was talking about. It did the rounds on the laravels podcasts and websites a while back now.

alinpop's avatar

For me the error was generated by the logger. I had an integration test and wanted to see some output.

Please or to participate in this conversation.