简体   繁体   English

如何修复 Sublime Text 中的“无法启动 Xdebug 调试会话”

[英]How to fix "Unable to start Xdebug debugging session" in Sublime Text

I am trying to use Xdebug in Sublime Text 3 in Fedora 31, but when I start debugging I get this error:我正在尝试在 Fedora 31 的 Sublime Text 3 中使用 Xdebug,但是当我开始调试时,出现此错误:

Unable to start Xdebug debugging session. 
Errno 13 Permission Denied

I installed xdebug as a prerequisite, which appears in phpinfo as well.我安装了 xdebug 作为先决条件,它也出现在phpinfo中。 Here is the output:这是输出:

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

Here are the xdebug settings in php.ini :以下是php.ini中的 xdebug 设置:

[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

I already give 777 permission to /usr/lib64/php/modules/xdebug.so but I'm still getting the same error.我已经向/usr/lib64/php/modules/xdebug.so授予了 777 权限,但我仍然遇到相同的错误。

Port 81 (and anything under 1024 ) is only available for the super user (root) to use.端口81 (以及1024下的任何端口)仅供超级用户(root)使用。 You need to configure a port number higher than 1024 , for example, the default of 9000 , or perhaps 9003 if 9000 is already in use.您需要配置一个大于1024的端口号,例如,默认值为9000 ,或者如果9000已在使用,则可能是9003

You need to change this both in php.ini ( xdebug.remote_port=9003 ) as well as in the Sublime settings.您需要在 php.ini ( xdebug.remote_port=9003 ) 以及 Sublime 设置中更改此设置。

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

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