用PHP fastcgi和eclipse配置Xdebug? [英] Xdebug configuration with PHP fastcgi and eclipse?
问题描述
我已经将eclipse-pdt与xdebug和apache结合使用了一年多了.一切工作都完美无瑕,我可以在eclipse中进行所有想要的交互式调试(使用我自己的机器作为服务器).
I have been using eclipse-pdt in conjunction with xdebug and apache without problems, for over one year. Things worked flawlessly and I could do all the interactive debugging I wanted from within eclipse (using my own machine as a server).
现在我从apache切换到nginx(因此PHP现在不是作为Apache服务运行,而是作为fast-cgi运行),并且我找不到一种方法来配置eclipse以使其与xdebug完美配合.我不确定问题是否出在xdebug或eclipse(或两者)上.
Now I switched from apache to nginx (and therefore PHP runs now not as an Apache service but as fast-cgi) and I can't find a way to configure eclipse to work nicely with xdebug. I am neither sure if the problem is with xdebug or with eclipse (or both) to be sure.
在eclipse配置中,我已经将对PHP配置文件的引用更改为/etc/php5/cli/php.ini
.
In the eclipse configuration I already changed the reference to the PHP configuration file to /etc/php5/cli/php.ini
.
使用以下php.ini
文件
zend_extension=/usr/lib/php5/20060613/xdebug.so
- 我看到xdebug正常工作(例如,如果我执行
var_dump()
,我会得到它的xdebug版本,而不是普通的PHP版本) - 我无法从eclipse进行交互式调试:浏览器打开并使用包含
...?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=...
的典型URL完全加载页面,但是程序执行不会在断点处停止 - 在月食的右下角,我看到一条可疑消息:启动= put_the_name_of_my_project_here =:57%" 与刷新工作空间" 交替出现.
- I see that xdebug is working (for example if I do a
var_dump()
I get the xdebug version of it, not the plain PHP one) - I can't have the interactive debugging from eclipse: the browser opens up and loads the page completely with the typical URL containing
...?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=...
, but the program execution does not stop at breakpoints - In the bottom-right corner of eclipse I see a suspicious message: "Launching =put_the_name_of_my_project_here=: 57%" that alternates with the "refreshing workspace" one.
如果我使用该文件的其他版本(直到我切换到nginx,它才起作用):
If I use this other version of the file (which is what it worked until I switched to nginx):
zend_extension=/usr/lib/php5/20060613/xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
我根本无法访问网站的任何页面.
I can't access any page of my sites at all.
PS:本机上的其他数据: -操作系统::GNU/Linux-Ubuntu 9.10 64位. - PHP:带有Suhosin-Patch 0.9.7的5.2.10-2ubuntu6.3; Zend Engine v2.2.0,版权所有(c)1998-2009 Zend Technologies with Xdebug v2.0.4 - Eclipse:参见屏幕截图.
PS: Additional data on my machine: - OS: GNU/Linux - Ubuntu 9.10 64 bit. - PHP: 5.2.10-2ubuntu6.3 with Suhosin-Patch 0.9.7; Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Xdebug v2.0.4 - Eclipse: see screenshot.
推荐答案
博的话是正确的(因为我是新来的,所以不能投票!).
What Beau said is correct (couldn't vote since I'm new!).
通常,将
zend_extension = /PATH_TO/xdebug.so ## <-- NOTE the absolute path, not relational (For ex on Windows: "C:\nginx-1.9.13\php\ext\php_xdebug-2.6.0RC2-7.0-vc14-nts.dll")
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9900 ## <-- Yours will be probly 9000 or other..
完成工作.
所以更改之后,
./php-fastcgi stop
./php-fastcgi start
这对我有用.
这篇关于用PHP fastcgi和eclipse配置Xdebug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!