首页 > 解决方案 > 如何修复 Sublime Text 中的“无法启动 Xdebug 调试会话”

问题描述

我试图在 Fedora 31 的 Sublime Text 3 中使用 Xdebug,但是当我开始调试时,我得到了这个错误:

Unable to start Xdebug debugging session. 
Errno 13 Permission Denied

我安装了 xdebug 作为先决条件,它也出现在其中 phpinfo。这是输出:

This program makes use of the Zend Scripting Language Engine: Zend Engine v3.3.13, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.0, Copyright (c) 2002-2019, by Derick Rethans
    with Zend OPcache v7.3.13, Copyright (c) 1999-2018, by Zend Technologies

以下是中的 xdebug 设置php.ini

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 81

我已经给了 777 权限,/usr/lib64/php/modules/xdebug.so 但我仍然遇到同样的错误。

标签: phpsublimetext3sublimetextxdebug

解决方案


端口81(以及 下的任何内容1024)仅供超级用户(root)使用。您需要配置一个高于 的端口号1024,例如,默认值9000,或者9003如果9000已经在使用中。

您需要在 php.ini ( xdebug.remote_port=9003) 以及 Sublime 设置中更改它。


推荐阅读