View Issue Details

IDProjectCategoryView StatusLast Update
0001906XdebugStep Debuggingpublic2020-12-10 12:14
Reporterpounard Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version3.0.0 
Summary0001906: XDEBUG_TRIGGER doesn't trigger anything when using PHPUnit
Description

It seems that PHPUnit or anything else messes up with $_ENV global variable on my environment.

I'm running the debug session this way:

XDEBUG_TRIGGER=1 vendor/bin/phpunit --filter=KernelConfigurationTest

My configuration is:

cat /etc/php/conf.d/xdebug.ini
zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable_trigger=1
xdebug.mode=debug,profile
xdebug.start_with_request=trigger
xdebug.log=/tmp/xdebug.log

If I print_r($_ENV), I only get this:

(
[ENABLE_EXT_PGSQL] => 1
[PGSQL_95_URI] => pgsql://postgres:foo@172.21.0.4:5432/postgres?server_version=13
)

Which are PHPUnit env vars from the phpunit.xml file.

But, whenver I do this:

print_r(\getenv('XDEBUG_TRIGGER'));

PHP prints out the variable from the commandline (which is what I'm awaiting for). Yet, XDebug still doesn't trigger.

Am I missing something here ?

Please note I also tried using legacy variables as documented XDEBUG_SESSION and XDEBUG_SESSION_START.

The /tmp/xdebug.log file has been created, but nothings goes into it.

Just for information, before XDebug 3.0.0 I always did the same, with XDEBUG_CONFIG="" to trigger it, it was working fine, something seems to have changed in the way you read $_ENV variables, or something changed in PHP 8 that doesn't like my configuration (I didn't changed it since the upgrade of XDebug and PHP).

Steps To Reproduce

Run:

XDEBUG_TRIGGER=1 vendor/bin/phpunit --filter=KernelConfigurationTest

And see nothing happening.

Additional Information

Header of my php -i

phpinfo()
PHP Version => 7.4.13

System => Linux blaster 5.9.11-arch2-1 #1 SMP PREEMPT Sat, 28 Nov 2020 02:07:22 +0000 x86_64
Build Date => Nov 24 2020 16:22:20
Configure Command => './configure' '--srcdir=../php-7.4.13' '--config-cache' '--prefix=/usr' '--sbindir=/usr/bin' '--sysconfdir=/etc/php' '--localstatedir=/var' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--disable-rpath' '--mandir=/usr/share/man' '--enable-cgi' '--enable-fpm' '--with-fpm-systemd' '--with-fpm-acl' '--with-fpm-user=http' '--with-fpm-group=http' '--enable-embed=shared' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-dba=shared' '--enable-exif=shared' '--enable-ftp=shared' '--enable-gd=shared' '--enable-intl=shared' '--enable-mbstring' '--enable-pcntl' '--enable-shmop=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--with-bz2=shared' '--with-curl=shared' '--with-db4=/usr' '--with-enchant=shared' '--with-external-gd' '--with-external-pcre' '--with-ffi=shared' '--with-gdbm' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-imap-ssl' '--with-imap=shared' '--with-kerberos' '--with-ldap=shared' '--with-ldap-sasl' '--with-mhash' '--with-mysql-sock=/run/mysqld/mysqld.sock' '--with-mysqli=shared,mysqlnd' '--with-openssl' '--with-password-argon2' '--with-pdo-dblib=shared,/usr' '--with-pdo-mysql=shared,mysqlnd' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=shared' '--with-pspell=shared' '--with-readline' '--with-snmp=shared' '--with-sodium=shared' '--with-sqlite3=shared' '--with-tidy=shared' '--with-unixODBC=shared' '--with-xmlrpc=shared' '--with-xsl=shared' '--with-zip=shared' '--with-zlib'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php
Loaded Configuration File => /etc/php/php.ini
Scan this dir for additional .ini files => /etc/php/conf.d
Additional .ini files parsed => /etc/php/conf.d/apcu.ini,
/etc/php/conf.d/igbinary.ini,
/etc/php/conf.d/redis.ini,
/etc/php/conf.d/xdebug.ini

PHP API => 20190902
PHP Extension => 20190902
Zend Extension => 320190902
Zend Extension Build => API320190902,NTS
PHP Extension Build => API20190902,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => enabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters => zlib., bzip2., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, convert.iconv.

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.0, Copyright (c) 2002-2020, by Derick Rethans

TagsNo tags attached.
Operating System
PHP Version8.0.0-8.0.4

Activities

pounard

2020-12-08 09:23

reporter   ~0005572

Oh, I'm really sorry for the noise, you changed approximately all the configuration variables names, I wrongly ommited to replace remote* using client* variables. It still doesn't explain why the xdebug log is empty, but I'll continue searching on my own.

Once again, thank you for everything, XDebug is the tool I use the most everyday, love it !

pounard

2020-12-08 09:23

reporter   ~0005573

This issue can be closed.

Issue History

Date Modified Username Field Change
2020-12-07 16:55 pounard New Issue
2020-12-08 09:23 pounard Note Added: 0005572
2020-12-08 09:23 pounard Note Added: 0005573
2020-12-10 12:14 derick Assigned To => derick
2020-12-10 12:14 derick Status new => closed
2020-12-10 12:14 derick Resolution open => no change required