Skip to content
Advertisement

Why xdebug 3 is not loaded?

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.

Advertisement

Answer

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

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement