Xdebug 3安装并显示在CLI上,但不显示在浏览器中使用phpinfo



我已经在Mac M1上安装了xdebug 3,当我运行php -v时,它显示我安装了xdebug。我在下面分享一些有价值的信息给你。

php -v
PHP 7.4.22 (cli) (built: Jul 29 2021 09:14:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
locate php.ini
/Library/WebServer/Documents/CP/php.ini.sample
/Library/WebServer/Documents/leohamel/php.ini.sample
/Library/WebServer/Documents/magento/php.ini.sample
/Library/WebServer/Documents/magento2/php.ini.sample
/Library/WebServer/Documents/magento2/vendor/magento/magento2-base/php.ini.sample
/Library/WebServer/Documents/magento_old/php.ini.sample
/System/Library/Templates/Data/private/etc/php.ini.default
/System/Volumes/Update/mnt1/System/Library/Templates/Data/private/etc/php.ini.default
/opt/homebrew/Cellar/php/8.0.9/.bottle/etc/php/8.0/php.ini
/opt/homebrew/Cellar/php@7.4/7.4.22/.bottle/etc/php/7.4/php.ini
/opt/homebrew/etc/php/7.4/php.ini
/opt/homebrew/etc/php/8.0/php.ini
/private/etc/#php.ini#
/private/etc/php.ini-5.2-previous
/private/etc/php.ini-previous
/private/etc/php.ini.default
/private/etc/php.ini.default-5.2-previous
/private/etc/php.ini.default-previous
/private/etc/php.ini.default-previous~orig
/private/etc/php.ini~
/usr/local/Cellar/valet-php@7.1/7.1.25/.bottle/etc/valet-php/7.1/php.ini
/usr/local/Cellar/valet-php@7.2/7.2.13/.bottle/etc/valet-php/7.2/php.ini

我正在使用这个php.ini/opt/homebrew/etc/php/7.4/php.ini在

中也有显示
php --ini
Configuration File (php.ini) Path: /opt/homebrew/etc/php/7.4
Loaded Configuration File:         /opt/homebrew/etc/php/7.4/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/7.4/conf.d
Additional .ini files parsed:      /opt/homebrew/etc/php/7.4/conf.d/ext-opcache.ini
which php
/opt/homebrew/opt/php@7.4/bin/php

当我将phpinfo输出粘贴到这里时,xdebug向导显示的是以下内容

Installation Wizard
Summary
Xdebug installed: no
Server API: FPM/FastCGI
Windows: no
Zend Server: no
PHP Version: 7.4.22
Zend API nr: 320190902
PHP API nr: 20190902
Debug Build: no
Thread Safe Build: no
OPcache Loaded: yes
Configuration File Path: /opt/homebrew/etc/php/7.4
Configuration File: /opt/homebrew/etc/php/7.4/php.ini
Extra Configuration Files Path: /opt/homebrew/etc/php/7.4/conf.d
Extra Configuration Files:
/opt/homebrew/etc/php/7.4/conf.d/ext-opcache.ini
Extensions directory: /opt/homebrew/lib/php/pecl/20190902
你能告诉我我做错了什么吗?或者我如何在浏览器输出中看到xdebug ?

php的一些版本将配置拆分为cli, fpm等区域。在这种情况下,如果希望为fpm启用xdebug,则需要将xdebug配置添加到fpm区域。要查找fpm的配置文件位置,键入next:

php-fpm -i | grep ini

检查:

php-fpm -v

最新更新