Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php xdebug、sublime-text-2和kindarispublimexdebug_Php_Linux_Xdebug_Sublimetext2 - Fatal编程技术网

Php xdebug、sublime-text-2和kindarispublimexdebug

Php xdebug、sublime-text-2和kindarispublimexdebug,php,linux,xdebug,sublimetext2,Php,Linux,Xdebug,Sublimetext2,我从未使用过Xdebug,但我想开始。我正在使用Ubuntu Linux,并且已经能够: 安装php5 xdebug并确保其正常工作 通过phpinfo()和var\u dump() 通过Sublime的软件包管理器安装插件 我可以通过SHIFT+F8设置Xdebug url访问插件的菜单 在崇高设置中: "settings": { "xdebug": { "url": "http://your.web.server" } } 以下是问题所在: 我可以在代码中放置断点,但图标似

我从未使用过Xdebug,但我想开始。我正在使用Ubuntu Linux,并且已经能够:

  • 安装php5 xdebug并确保其正常工作
    通过
    phpinfo()
    var\u dump()
  • 通过Sublime的软件包管理器安装插件
    我可以通过SHIFT+F8设置Xdebug url访问插件的菜单
  • 在崇高设置中:

    "settings": {
        "xdebug": { "url": "http://your.web.server" }
    }
    
以下是问题所在:

  • 我可以在代码中放置断点,但图标似乎错误, 它只是一个橙色的斑点
  • 当我“开始调试”时,调试窗口显示为完全空
  • 当我访问脚本时,它不会在断点处停止

我做错了什么?

您可以启用xdebug日志来调试xdebug。

这些是为我工作的全部步骤

sudo -i
apt-get install php5-xdebug
vim /etc/php5/conf.d/xdebug.ini
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
:wq
apachectl restart
exit
Download do SublimeXdebug
unzip
move folder para ~/.config/sublime-text-2/Packages/Xdebug
Download python 2.6 (careful with i386 vs amd64)
dpkg-deb -x python2.6_2xxxx.deb python2.6
move folder to ~/sublime/lib/python2.6
open google chrome
chrome://settings/extensions
Get more extensions
search for xdebug
install xdebug helper
go to "options" of xdebug helper
in IDE type "other" and in input "sublime.xdebug"
start sublime
open file test.php
add breakpoints
start debugging
in chrome go to http://localhost/test.php
activate the icon of the plugin
refresh

就是这样

这是一个非常酷的工具,来自phpStorm的制造商Jetbrains:

基本上,只需输入xdebug(或者zend debugger,如果你喜欢的话)IDE的IDE键,它就会创建bookmarklet来连接和启用各种功能

对于sublime text 2,IDE键为:

升华

使用bookmarklets时,不需要在两端输入任何服务器信息。只要在每台计算机上“启动调试器”,一切都会自行解决,只要保留默认设置即可

当然,您仍然需要在您的服务器上启用xdebug。

我遇到了类似的问题(虽然我在Windows 7上运行),对我有效的方法是确保我以Windows管理员的身份运行Sublime Text 2。我相信这是有道理的,因为xDebug是系统的第三方dll

也许以超级用户的身份运行sublime(使用SUDO)对您的情况会有所帮助


希望这能解决您的问题。

您的sublime是否也无法保存项目设置,如最近的项目列表

我也有同样的问题,你可以在这里看到:


解决方案是删除/移动~/.config/sublime-text-2文件夹,然后用新的sublime重新开始。之后,断点看起来很正常,我的调试器将连接:)

我启用它写入日志文件,文件仍然为空。您可以尝试连接到xdebug,并将字符串xdebug_SESSION_START附加到url。实际上,我在xdebug和ST2中遇到了同样的问题,到目前为止还无法找到解决方案。希望有人能提供答案。我已经发布了一个对我有用的答案…什么是
para
metes
意思?对不起,我忘了翻译一点葡萄牙语。我编辑了答案。我们可以使用python2.6的任何版本,因为它不容易使用。我可以使用idle-python2.6_2.6.8-1.1_all.deb吗