0

I use PHP 7.4.26 with Xdebug 3.1.1, Apache/2.4.41 (Ubuntu) and PhpStorm as a client.

In the xdebug log file I see that any variable I use in my PHP script come as 'uninitialized'

So whatever my script contains I receive only 4 variables $_COOKIE, $_GET, $_REQUEST, $_SERVER.

My Xdebug settings:

zend_extension=xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.discover_client_host = false
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9000
xdebug.log=/xdebug.log
LazyOne
  • 158,824
  • 45
  • 388
  • 391
Adam Mason
  • 45
  • 8
  • 2
    1) Is this a CLI script debug or a web page? 2) Make a new file with basic logic where each command is on separate line, like ` – LazyOne Nov 28 '21 at 17:20
  • 1) This is a web page 2) No 3) Here my log https://docs.google.com/document/d/1kDEFo0H-SI0d6R_jOEMaeXMdNBfbB3dpZz3cNJyZMSI/edit?usp=sharing 4) Here several screenshots https://i.imgur.com/Z46w6fl.png https://i.imgur.com/VXT3TZv.png https://i.imgur.com/UK3MtmG.png https://i.imgur.com/NPH0Hwo.png – Adam Mason Nov 30 '21 at 04:44
  • So .. what happens next? From what I see the breakpoint was resolved just fine (line #4) in the right script (`/var/www/html/index.php`). It stopped at line #2 as you must have "Break at first line in PHP scripts" option enabled. So far everything is good on your screenshots -- I see nothing wrong at all. **What happens next when you do "Step over" to move to the next line?** Try making a screencast/video (there are many free tools) that will show the whole process of the whole screen. – LazyOne Nov 30 '21 at 11:35
  • So far I do not see any `uninitialized` anywhere on your screenshots. I see it in the log at line #63 -- the response for command #19. But that's absolutely expected -- while execution is stopped at line #2 (as per your screenshot) those `$a`, `$b` and `$c ` and not yet initialized at that point. `$a` will become known/initialized only when `$a = 1;` will be actually executed. – LazyOne Nov 30 '21 at 11:36

0 Answers0