繁体   English   中英

Valet、Xdebug 重启后 Big Sur 不工作

[英]Valet, Xdebug after reboot Big Sur not working

在成功安装 Valet、Xdebug 并为 Xdebug 3. 的侦听器配置 VSCODE 并检查一切正常后,在 Mac(OS:Big Sur)的第一次关机和开机时,Xdebug 开始停止工作。

我尝试使用命令重新启动代客泊车

valet restart

但没有什么 Xdebug 仍然不起作用。

PHP 和 Xdebug 的版本:

/usr/local/bin/php -v
PHP 7.4.21 (cli) (built: Jul 12 2021 11:57:26) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies
    with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans

PHP ini:

php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File:         /usr/local/etc/php/7.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.4/conf.d/error_log.ini,
/usr/local/etc/php/7.4/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini,
/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini

配置 Xdebug ini:

# Configuration for Xdebug 3
[Xdebug]
zend_extension="xdebug.so"
xdebug.mode=debug
xdebug.start_with_request=default
xdebug.idekey=VSCODE
xdebug.client_port=9003
xdebug.client_host=127.0.0.1
xdebug.start_upon_error=yes
xdebug.discover_client_host=1

VSCODE 设置.json

{
    "php.validate.executablePath": "/usr/bin/php",
    "intelephense.environment.phpVersion": "7.4",
    "intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": true,
    "grunt.autoDetect": "on",
    "artisan.php.location": "/usr/local/bin/php"
}

配置 myproject/.vscode/lunch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
        }
    ]
}

这是 xdebug_info() 的输出

我该如何解决?

在寻找解决方案的 3 个小时后,我安装了两个扩展程序,一个用于 Google Chrome,一个用于 Safari,并且神奇地 Xdebug 恢复工作了。

我不明白为什么我必须在浏览器上安装扩展程序( Safari 扩展程序Chrome 扩展程序)才能使 Xdebug 工作。

在 Xdebug 工作之前,无需在各种浏览器上安装扩展。 这怎么可能?

你能向我解释一下吗?

如何避免在浏览器上使用扩展来使 Xdebug 工作?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM