在Docker容器中,php(unit)不显示错误输出
我认识到这可能是一个PHP的configuration问题,而不是docker或phpunit,但我想清楚不同的移动件。
我有一个docker容器与下面的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
当我使用( docker run -it my_php bash
) docker run -it my_php bash
bash的容器时,我可以validationphp和xdebug是否正确安装。
当我尝试运行vendor/bin/phpunit
,testing开始,遇到一个错误,然后进程简单地死亡,没有错误输出。 失败的testing显示失败并通过testing显示绿色。
以下为什么phpunit不能在控制台中显示任何错误 ,我已经添加了
ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1');
到testingbootstrap.php
文件中
<ini name="display_errors" value="On" /> <ini name="display_startup_errors" value="On" />
到phpunit.xml.dist文件(冗余,我知道)。
当我运行php -i
它实际上说没有php.ini
文件
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
我很高兴发布任何其他日志或php -i
输出的全部内容。
谢谢您的帮助!