使用PHP fastcgi和eclipse进行Xdebug配置?

前端之家收集整理的这篇文章主要介绍了使用PHP fastcgi和eclipse进行Xdebug配置?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在使用 eclipse-pdt与xdebug和apache一起使用超过一年.事情完美无缺,我可以在eclipse中完成我想要的所有交互式调试(使用我自己的机器作为服务器).

现在我从apache切换到Nginx(因此PHP现在不是作为Apache服务而是作为fast-cgi运行)而且我找不到一种方法来配置eclipse与xdebug很好地协同工作.我不确定xdebug或eclipse(或两者)的问题是否确定.

在eclipse配置中,我已经将对PHP配置文件的引用更改为/etc/PHP5/cli/PHP.ini.

尝试使用PHP.ini版本1

使用以下PHP.ini文件

zend_extension=/usr/lib/PHP5/20060613/xdebug.so

>我看到xdebug正在工作(例如,如果我执行var_dump(),我得到它的xdebug版本,而不是普通的PHP版本)
>我无法从eclipse进行交互式调试:浏览器打开并使用包含…的典型URL完全加载页面??XDEBUG_SESSION_START = ECLIPSE_DBGP& KEY = …,但程序执行不会在断点处停止
>在eclipse的右下角,我看到一条可疑消息:“Launching = put_the_name_of_my_project_here =:57%”与“刷新工作区”交替显示.

尝试使用PHP.ini版本2

如果我使用该文件的其他版本(在切换到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

我根本无法访问我网站的任何页面.

PS:我机器上的其他数据:
– 操作系统:GNU / Linux – Ubuntu 9.10 64位.
PHP:5.2.10-2ubuntu6.3与Suhosin-Patch 0.9.7; Zend Engine v2.2.0,版权所有(c)1998-2009 Zend Technologies with Xdebug v2.0.4
– Eclipse:看截图.

博说的是正确的(因为我是新人,所以不能投票!).

一般来说,添加到/etc/PHP5/cgi/PHP.ini(或定位PHP.ini)这样的行

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

这对我有用.

原文链接:https://www.f2er.com/php/138699.html

猜你在找的PHP相关文章