调试不开始(Debugging not starting)

编程入门 行业动态 更新时间:2024-10-14 18:17:55
调试不开始(Debugging not starting)

更新:

我在这方面花了太多时间,决定抛弃它并继续使用笨重的NetBeans。

原文问题:

我在使用xdebug与崇高的文本2工作时遇到了一些困难。

我迄今为止所做的是安装:

灯, PHP5-的XDebug python2.6的 崇高的文本-2 sublimexdebug

如果我然后使用崇高打开一个PHP文件,并按Shift + F8,弹出xdebug菜单,我可以从中add/remove breakpoint ,也start debugging 。

一些php:

当我按shift + f8时菜单下降:

调试开始:

该图像中说:

Xdebug: No URL defined in project settings file

Info.sublime-project包含:

{ "folders": [ { "path": "/var/www" } ], "settings": { "xdebug": { "url": "http://localhost" } } }

从第三张截图中可以看到,我已经开始调试,没有任何事情发生,没有错误,没有浏览器窗口打开,什么都没有。 如果我手动导航到localhost/info.php ,则页面将正常加载。 如果我手动添加?XDEBUG_SESSION_START=sublime.xdebug到url的末尾以便localhost/info.php?XDEBUG_SESSION_START=sublime.xdebug并在浏览器中点击刷新,页面将正常加载并且调试仍然无法启动。

我究竟做错了什么?

更新:关于端口的一些信息:

在尝试通过崇高文本启动xdebug 2之前

oshirowanen@ubuntu:~$ netstat -antp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - tcp 0 0 90.190.20.220:54913 90.180.80.70:443 ESTABLISHED 2439/python tcp 0 0 90.190.20.220:51727 190.40.210.160:443 TIME_WAIT - tcp 1 0 90.190.20.220:50967 90.180.90.20:80 CLOSE_WAIT 2349/ubuntu-geoip-p tcp6 0 0 :::80 :::* LISTEN - oshirowanen@ubuntu:~$

手动启动铬并通过崇高文本2启动xdebug

oshirowanen@ubuntu:~$ netstat -antp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 2241/dropbox tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:59424 127.0.0.1:80 ESTABLISHED 2924/chromium-brows tcp 0 0 127.0.0.1:43123 127.0.0.1:9000 ESTABLISHED - tcp 0 0 127.0.0.1:9000 127.0.0.1:43123 ESTABLISHED 2903/sublime_text tcp 0 0 90.190.20.220:40809 170.190.40.70:443 ESTABLISHED 2924/chromium-brows tcp 0 0 90.190.20.220:54913 90.180.80.70:443 ESTABLISHED 2439/python tcp 0 0 90.190.20.220:43900 170.190.70.90:443 ESTABLISHED 2924/chromium-brows tcp 0 0 90.190.20.220:35259 170.190.70.100:443 ESTABLISHED 2924/chromium-brows tcp 0 0 127.0.0.1:59426 127.0.0.1:80 TIME_WAIT - tcp 0 0 90.190.20.220:37922 170.190.70.90:443 ESTABLISHED 2924/chromium-brows tcp 1 0 90.190.20.220:50967 90.180.90.20:80 CLOSE_WAIT 2349/ubuntu-geoip-p tcp 0 0 90.190.20.220:40847 170.190.40.60:80 ESTABLISHED 2924/chromium-brows tcp6 0 0 :::80 :::* LISTEN - tcp6 0 0 127.0.0.1:80 127.0.0.1:59423 TIME_WAIT - tcp6 0 0 127.0.0.1:80 127.0.0.1:59424 ESTABLISHED - oshirowanen@ubuntu:~$

UPDATE:

I've spent way too much time on this and have decided to ditch it and continue using the clunky NetBeans.

ORIGINAL QUESTION:

I'm having some difficulty getting xdebug to work with sublime text 2.

What I have done so far is install:

LAMP, php5-xdebug python2.6 sublime-text-2 sublimexdebug

If I then use sublime to open a php file and press shift+f8, the xdebug menu pops up from which I can add/remove breakpoint and also start debugging.

Some php:

Menu drops down when I press shift+f8:

Debugging started:

In that image it says:

Xdebug: No URL defined in project settings file

Info.sublime-project contains:

{ "folders": [ { "path": "/var/www" } ], "settings": { "xdebug": { "url": "http://localhost" } } }

As you can see from the 3rd screenshot, I have started debugging and nothing happens, no errors, no browser window opens, nothing. If I manually navigate to localhost/info.php, the page loads as normal. If I manually add ?XDEBUG_SESSION_START=sublime.xdebug to the end of the url so localhost/info.php?XDEBUG_SESSION_START=sublime.xdebug and hit refresh on the browser, the page loads as normal and debugging still doesn't start.

What am I doing wrong?

UPDATE: Some info about ports:

Before trying to start xdebug via sublime text 2

oshirowanen@ubuntu:~$ netstat -antp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - tcp 0 0 90.190.20.220:54913 90.180.80.70:443 ESTABLISHED 2439/python tcp 0 0 90.190.20.220:51727 190.40.210.160:443 TIME_WAIT - tcp 1 0 90.190.20.220:50967 90.180.90.20:80 CLOSE_WAIT 2349/ubuntu-geoip-p tcp6 0 0 :::80 :::* LISTEN - oshirowanen@ubuntu:~$

After starting chromium manually and starting xdebug via sublime text 2

oshirowanen@ubuntu:~$ netstat -antp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 2241/dropbox tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:59424 127.0.0.1:80 ESTABLISHED 2924/chromium-brows tcp 0 0 127.0.0.1:43123 127.0.0.1:9000 ESTABLISHED - tcp 0 0 127.0.0.1:9000 127.0.0.1:43123 ESTABLISHED 2903/sublime_text tcp 0 0 90.190.20.220:40809 170.190.40.70:443 ESTABLISHED 2924/chromium-brows tcp 0 0 90.190.20.220:54913 90.180.80.70:443 ESTABLISHED 2439/python tcp 0 0 90.190.20.220:43900 170.190.70.90:443 ESTABLISHED 2924/chromium-brows tcp 0 0 90.190.20.220:35259 170.190.70.100:443 ESTABLISHED 2924/chromium-brows tcp 0 0 127.0.0.1:59426 127.0.0.1:80 TIME_WAIT - tcp 0 0 90.190.20.220:37922 170.190.70.90:443 ESTABLISHED 2924/chromium-brows tcp 1 0 90.190.20.220:50967 90.180.90.20:80 CLOSE_WAIT 2349/ubuntu-geoip-p tcp 0 0 90.190.20.220:40847 170.190.40.60:80 ESTABLISHED 2924/chromium-brows tcp6 0 0 :::80 :::* LISTEN - tcp6 0 0 127.0.0.1:80 127.0.0.1:59423 TIME_WAIT - tcp6 0 0 127.0.0.1:80 127.0.0.1:59424 ESTABLISHED - oshirowanen@ubuntu:~$

最满意答案

一些技巧:

检查Xdebug是否在运行检查由phpinfo命令生成的信息。

在xdebug配置中启用远程调试(并使用phpinfo命令再次验证):

xdebug.remote_enable = 1

我不使用Sublime Text中的xdebug设置。 我认为这不是必要的。

在Sublime Text中打开控制台。 控制台中记录任何问题。 Ubuntu在pulgin主页上报告了一些问题。

我使用浏览器扩展来激活或取消激活调试。 在Chrome中查找“Xdebug Helper for Chrome”。 您需要将cookie名称配置为“sublime.xdebug”。

Some tips:

Check that Xdebug is running checking the information generated by the phpinfo command.

Enable remote debugging in the xdebug configuration (and verify again with the phpinfo command):

xdebug.remote_enable=1

I don't use the xdebug setting in Sublime Text. I think it is not necessary.

Open the console in Sublime Text. Any problem is logged in the console. There are some problems in Ubuntu reported in the pulgin homepage.

I use a browser extension to activate or deactivate the debugging. In Chrome look for "Xdebug Helper for Chrome". You need to configure the cookie name as "sublime.xdebug".

更多推荐

xdebug,php,sublime,info,电脑培训,计算机培训,IT培训"/> <meta name="descr

本文发布于:2023-08-02 21:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1381923.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Debugging   starting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!