Why Xdebug 3 log is empty?

1.4k Views Asked by At
zend_extension=/usr/lib/php/20190902/xdebug.so

xdebug.mode=debug

xdebug.log=/var/log/xdebug.log

I had set permissions 777 to xdebug.log file

I run

php7.4 index.php 

PhpStorm listening is on.

enter image description here

enter image description here

Code does not stop on breakpoints when running from command line, so probably I need to check the log for info.

2

There are 2 best solutions below

7
On BEST ANSWER

Based on @LazyOne comment, tried this way and it works - stops at breakpoints and log file gets recorded:

php7.4 -d xdebug.start_with_request=yes index.php 
0
On

Here is configuration, that correctly works with nginx + php-fpm in docker, xdebug3, activation with Chrome/Firefox extension.

[Xdebug]
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
xdebug.idekey=PHPSTORM
xdebug.log=/var/log/xdebug.log

More details about combinations of configuration for xdebug.mode and xdebug.start_with_request params, you can find here. Also, when using the nginx web server, debugging may fail if the

$_SERVER["SERVER_NAME"]

is not provided by PHP. To solve this, add a fastcgi parameter to the nginx configuration(e.g., /etc/nginx/conf.d/symfony.conf):

fastcgi_param SERVER_NAME $server_name;

or

fastcgi_param SERVER_NAME $host;