0

我已经重新启动了 nginx 和 php7.4-fpm。

xdebug 3 看起来是基于此安装的:

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

来自 phpinfo() 的 ini 目录:

加载的配置文件 /etc/php/7.4/fpm/php.ini 扫描此目录以获取其他 .ini 文件 /etc/php/7.4/fpm/conf.d 解析的其他 .ini 文件 /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.inid/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 .inid/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 内容:

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

我不知道如何检查这是否是正确的文件。他们在文档中写道:

将以下行添加到 php.ini:

zend_extension=/无论在哪里/你/put/it/xdebug

我怎么知道我放在哪里?:) 它是通过 install 命令安装的,它放在它放置的位置 :) 在那个目录中没有没有 .so 的文件。我只是使用了与 xdebug 2 类似的目录和文件名。

phpinfo() 不显示已加载 xdebug。

添加 xdebug_info(); 文件崩溃页面 - 可能未定义此功能。

4

1 回答 1

2

正如@LazyOne 所说

对于 PHP 7.4,文件夹应该是 20190902

所以在ini文件中设置

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

为 Php 7.4 加载 xdebug 3。谢谢

于 2020-12-09T14:21:54.533 回答