我在 VirtualBox 上為自己設定了一個 Debian 服務器,除了 Xdebug 無法啟動之外,一切都很好。在服務器上,我有使用vhost admin.localwww.plHTTPS 的Symfony 3 應用程式。
我的php -v結果:
PHP 7.3.31-2 0~20211022.89 debian11~1.gbp745ac7 (cli) (built: Oct 22 2021 12:37:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.31, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.31-2 0~20211022.89 debian11~1.gbp745ac7, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans
我的 xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_host=127.0.0.1
xdebug.remote_port = 9003
xdebug.idekey = PHPSTORM
xdebug.mode=debug
xdebug.show_error_trace = 1
xdebug.remote_autostart = 1
我的 PhpStorm 設定:



當我運行 PHP 遠程除錯配置時,我看到:

無論我是添加?XDEBUG_SESSION_START=PHPSTORM到 URL 還是在 Google Chrome 中使用 Xdebug Helper,效果都是一樣的:盡管設定了斷點,但沒有任何反應。
我從 VM 上的遠程服務器使用 PHP CLI:

編輯:我當前的配置但仍然不起作用:
zend_extension=xdebug.so
xdebug.idekey=PHPSTORM
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port = 9003
uj5u.com熱心網友回復:
您的所有設定均參考 Xdebug 2 設定,其中您使用的是 Xdebug 3.1.1 — 請閱讀升級指南:https : //xdebug.org/docs/upgrade_guide
uj5u.com熱心網友回復:
請在任何頁面上使用函式 xdebug_info() 來接收診斷資料。另外請設定 xdebug_log。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/348209.html
