0

I have restarted nginx and php7.4-fpm.

xdebug 3 looks like is installed based on this:

root@darius-Vostro-5481:/home/darius/Private/Projects/vop7# apt search xdebug
Sorting... Done
Full Text Search... Done
php-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed]
  Xdebug Module for PHP

php5.6-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed,automatic]
  Xdebug Module for PHP

php7.0-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed,automatic]
  Xdebug Module for PHP

php7.1-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed]
  Xdebug Module for PHP

php7.2-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed,automatic]
  Xdebug Module for PHP

php7.3-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed,automatic]
  Xdebug Module for PHP

php7.4-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed,automatic]
  Xdebug Module for PHP

php8.0-xdebug/bionic,now 3.0.1+2.9.8+2.8.1+2.5.5-1+ubuntu18.04.1+deb.sury.org+1 amd64 [installed,automatic]
  Xdebug Module for PHP

Ini directories from phpinfo():

Loaded Configuration File /etc/php/7.4/fpm/php.ini Scan this dir for additional .ini files /etc/php/7.4/fpm/conf.d Additional .ini files parsed /etc/php/7.4/fpm/conf.d/10-opcache.ini, /etc/php/7.4/fpm/conf.d/10-pdo.ini, /etc/php/7.4/fpm/conf.d/15-xml.ini, /etc/php/7.4/fpm/conf.d/20-bcmath.ini, /etc/php/7.4/fpm/conf.d/20-calendar.ini, /etc/php/7.4/fpm/conf.d/20-ctype.ini, /etc/php/7.4/fpm/conf.d/20-dom.ini, /etc/php/7.4/fpm/conf.d/20-exif.ini, /etc/php/7.4/fpm/conf.d/20-ffi.ini, /etc/php/7.4/fpm/conf.d/20-fileinfo.ini, /etc/php/7.4/fpm/conf.d/20-ftp.ini, /etc/php/7.4/fpm/conf.d/20-gettext.ini, /etc/php/7.4/fpm/conf.d/20-iconv.ini, /etc/php/7.4/fpm/conf.d/20-igbinary.ini, /etc/php/7.4/fpm/conf.d/20-imagick.ini, /etc/php/7.4/fpm/conf.d/20-json.ini, /etc/php/7.4/fpm/conf.d/20-phar.ini, /etc/php/7.4/fpm/conf.d/20-posix.ini, /etc/php/7.4/fpm/conf.d/20-readline.ini, /etc/php/7.4/fpm/conf.d/20-redis.ini, /etc/php/7.4/fpm/conf.d/20-shmop.ini, /etc/php/7.4/fpm/conf.d/20-simplexml.ini, /etc/php/7.4/fpm/conf.d/20-sockets.ini, /etc/php/7.4/fpm/conf.d/20-sysvmsg.ini, /etc/php/7.4/fpm/conf.d/20-sysvsem.ini, /etc/php/7.4/fpm/conf.d/20-sysvshm.ini, /etc/php/7.4/fpm/conf.d/20-tokenizer.ini, /etc/php/7.4/fpm/conf.d/20-xdebug.ini, /etc/php/7.4/fpm/conf.d/20-xmlreader.ini, /etc/php/7.4/fpm/conf.d/20-xmlwriter.ini, /etc/php/7.4/fpm/conf.d/20-xsl.ini, /etc/php/7.4/fpm/conf.d/20-zip.ini

/etc/php/7.4/fpm/conf.d/20-xdebug.ini content:

# xdebug 3 -          
zend_extension=/usr/lib/php/20200930/xdebug.so

I do not know how to check if this is the right file. They write in the docs:

Add the following line to php.ini:

zend_extension=/wherever/you/put/it/xdebug

How can I know where I put? :) It was installed by install command, it put where it put :) In that directory there is no file without .so . I just used similar directory and file name to what was xdebug 2.

phpinfo() does not show xdebug loaded.

Adding xdebug_info(); to file crashes the page - probably this function is not defined.

Darius.V
  • 737
  • 1
  • 13
  • 29
  • 1
    I have a feeling there may be a issue with XDEBUG3 on PHP7.4. I can get it running on PHP8 but not on 7.4 or 7.3 although I am using windows – RiggsFolly Dec 08 '20 at 17:28
  • 2
    @Darius.V 1) Xdebug 3 is available for PHP 7.1 and newer ONLY. 2) for PHP **7.4** the folder should be `20190902`. `20200930` is for PHP **8.0**. – LazyOne Dec 09 '20 at 13:21
  • @RiggsFolly Sounds like you have downloaded wrong Xdebug build. Works fine here with PHP 7.4. Show top of the `php -i` output for your PHP 7.3/7.4 -- to see what version those are. There are TS and NTS builds and each either for x86 (32 but) or x64 bit. If it's Apache then you most likely need TS build. If it's IIS then NTS. – LazyOne Dec 09 '20 at 13:24
  • Hi @LazyOne Anything is possible I guess. I am aware of the TS and NTS options I am definitely a TS user. Oh must have been one of those days yesterday, now it works just fine :) – RiggsFolly Dec 09 '20 at 13:39

2 Answers2

2

As @LazyOne said

for PHP 7.4 the folder should be 20190902

So setting in ini file

zend_extension=/usr/lib/php/20190902/xdebug.so

loads xdebug 3 for Php 7.4 . Thanks

Darius.V
  • 737
  • 1
  • 13
  • 29
0

Sometimes it is just because you used "#" for comments instead of ";" (Stupidly enough)

Nadir
  • 695
  • 8
  • 12