2014-05-15 45 views
0

我的XDebug本地的“正常”网站(我使用谷歌浏览器与Xdebug的助手和phpstorm交谈托管在一个流浪汉框的网站)的工作。Xdebug的本地API使用流浪汉

但是,如果我尝试使用REST客户端(谷歌浏览器的高级休息客户端插件)它不会工作,连接到本地托管API的网站(也流浪汉框)。

我需要什么设置了XDebug在漂浮的盒子,而我需要什么样的附加信息进行API调用时要包括哪些内容?

我的设置(无业游民机)这对于phpstorm和流浪汉箱工作如下:

;;;;;;;;;;;;;;;;;;;;;;;;;; 
    ; Added to enable Xdebug ; 
    ;;;;;;;;;;;;;;;;;;;;;;;;;; 
    zend_extension="/usr/lib/php5/20100525/xdebug.so" 
    xdebug.default_enable = 1 
    xdebug.idekey = "vagrant" 
    xdebug.remote_enable = 1 
    xdebug.remote_autostart = 0 
    xdebug.remote_port = 9000 
    xdebug.remote_handler=dbgp 
    xdebug.remote_log="/var/log/xdebug/xdebug.log" 
    xdebug.remote_host=10.0.2.2 

的idekey设置连接到phpstorm用户定义的应用程序(在这里看到:http://www.mailbeyond.com/phpstorm-vagrant-install-xdebug-php

+0

和..你如何调试“正常”的网站?请描述(简而言之)。到目前为止(据我所知)xdebug缺少调试标记(cookie或GET/POST参数,告诉xdebug调试此请求)。在浏览器中,这个cookie通过特殊的浏览器扩展或书签添加/删除。或者,当从IDE启动时,GET参数被添加到URL。对于API调用,您需要自己添加这些信息。或者配置xdebug来调试每个请求。 – LazyOne

+0

对于'正常'站点I:使用上面列出的流浪机上的设置;使用谷歌Chrome浏览器的Xdebug的帮手,其发送所需要的会话开始信息,并配置phpstorm这里http://www.mailbeyond.com/phpstorm-vagrant-install-xdebug-php概述通过创建一个“服务器”,并将其安装到调试配置(这是多么xdebug.idekey =“流浪汉”会谈phpstorm) – timhc22

+0

我似乎无法得到它与REST客户一起工作,即使我包括调试标记为这里概述:http://stackoverflow.com/questions/19139803/ Xdebug的-A-宁静的服务器 - 使用 - phpstorm - 或 - 邮递员在php.ini – timhc22

回答

2

通过很多努力设法与@LazyOne

这里是我的最终设置帮助解决这个问题,如果别人需要帮助:

的XDebug对于API

; Enable xdebug extension module 
zend_extension=xdebug.so 

; see http://xdebug.org/docs/all_settings 
xdebug.max_nesting_level = 250 
xdebug.max_nesting_level = 250 
;for ubuntu 
zend_extension="/usr/lib/php5/20100525/xdebug.so" 
;for centos 
;zend_extension="/usr/lib64/php/modules/xdebug.so" 
xdebug.default_enable = 1 
xdebug.idekey = "PHPSTORM" 
xdebug.remote_enable = 1 
xdebug.remote_autostart = 0 
xdebug.remote_port = 9000 
xdebug.remote_handler=dbgp 
xdebug.remote_log="/var/log/xdebug/xdebug.log" 
xdebug.remote_host=10.0.2.2 

•更改Symfony2的app_dev.php到:

//$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; 
$loader = require_once __DIR__.'/../app/autoload.php'; 

•可能还需要将断点上app_dev.php和尝试 '步入' 的主要项目。这将提示你设置的路径编辑路径映射链接:http://blog.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/

•在REST客户端作为标题:饼干XDEBUG_SESSION = PHPSTORM

还需要包括:

?XDEBUG_SESSION_START=PHPSTORM (e.g. /courses/?XDEBUG_SESSION_START=PHPSTORM) 

为一个参数,如果使用REST客户端。 PHPSTORM的客户端会自动添加它

enter image description here