【问题标题】:Xdebug 3 is installed and showing on CLI but not showing in browser using phpinfoXdebug 3 已安装并显示在 CLI 上,但未使用 phpinfo 在浏览器中显示
【发布时间】:2023-04-03 13:45:01
【问题描述】:

我在 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?

【问题讨论】:

    标签: macos magento php-7.4 phpinfo xdebug-3


    【解决方案1】:

    某些 php 版本具有将配置拆分为多个区域:cli、fpm 等。 在这种情况下,如果要为 fpm 启用 xdebug,则需要在 fpm 区域添加 xdebug 配置。 要查找 fpm 的配置文件位置,请输入下一个:

    php-fpm -i | grep ini
    

    检查:

    php-fpm -v
    

    【讨论】:

    • 原来我不得不重启php-fpm来解决这个问题。
    猜你喜欢
    • 2020-11-21
    • 2019-02-15
    • 2012-12-12
    • 1970-01-01
    • 2010-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多