php - 如何修复 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
但我仍然遇到同样的错误。
解决方案
端口81
(以及 下的任何内容1024
)仅供超级用户(root)使用。您需要配置一个高于 的端口号1024
,例如,默认值9000
,或者9003
如果9000
已经在使用中。
您需要在 php.ini ( xdebug.remote_port=9003
) 以及 Sublime 设置中更改它。
推荐阅读
- php - 通过键和值 PHP 对多数组进行分组
- javascript - 数据验证 - 正确显示密码要求
- javascript - Babel preset minify TypeError: _interopRequireDefault is not a function
- python - 为什么没有检测到我的 urls.py 文件?
- java - 如何在 Java Web 代码中编写 Python 3 代码?
- apache - 为什么 localhost 显示“它有效!” 而不是我的文件?
- recursion - SML - 生成列表所有可能组合的函数
- reactjs - Firebase:从嵌套的 onSnapshot 获取数据时出现问题
- python-3.x - 如何动态设置 tkinter 标签的名称
- nginx - 如何根据配置更改更新 kuberenet pod?