4

I recognize this is likely a php configuration issue and not docker or phpunit, but I wanted to be clear about the different moving pieces.

I have a docker container with the following Dockerfile

FROM php:5.6-cli
COPY . /spider
WORKDIR /spider

RUN pecl install xdebug
RUN docker-php-ext-enable xdebug

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer

When I run that container for bash using (docker run -it my_php bash) I can verify that php and xdebug are installed correctly.

When I try to run vendor/bin/phpunit, the tests begin, run into an error, and then the process simply dies with no error output. Failed tests show failures and passed tests show green.

Following Why does phpunit not show any errors in the console, I have added

ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');

to the tests bootstrap.php file AND

<ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" />

to the phpunit.xml.dist file (redundant, I know).

When I run php -i it actually says there is no php.ini file

Configuration File (php.ini) Path => /usr/local/etc/php
Loaded Configuration File => (none)
Scan this dir for additional .ini files => /usr/local/etc/php/conf.d
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

I am happy to post any other logs or the entire contents of the php -i output.

Thanks for the help!

Community
  • 1
  • 1
Apollo
  • 945
  • 2
  • 9
  • 24

0 Answers0