7

我不能使用 Xdebug 来调试使用 Code Igniter 构建的应用程序,但我可以使用它来调试任何其他 PHP 文件,只要它不使用与 Code Igniter 相同的结构来解决 URL 问题。

含义:在一个没有 Code Igniter 的简单 PHP 文件中,当我使用 NetBeans 调试时,浏览器会转到:http://localhost:86/index.php?XDEBUG_SESSION_START=netbeans-xdebug

由于没有使用 Code Igniter 或其他框架,NetBeans 可以实际调试 PHP。


但是当在 NetBeans 中点击调试按钮时使用 Code Igniter 时,浏览器会转到:

http://localhost:86/index.php?XDEBUG_SESSION_START=netbeans-xdebug

所有发生在 Code Igniter 中的根 index.php 都没有运气,相反,我得到了标准的 CodeIgniter “404 Page not Found”。

我的猜测是,由于 Code Igniter 用于 url 解析的结构 Segments,xdebug 无法调试任何内容。

示例:example.com/class/function/ID

如何使 xdebug 与 Code Igniter 一起工作?

使用:

  • Windows 7 32 位。
  • XAMPP 版本 1.7.3。
  • PHP 5.3.1
  • Xdebug v2.0.6-dev
4

3 回答 3

4

我找不到上面链接的文章......但设法将各种旧帖子和其他文章拼凑起来,提出了一个 codeigniter/netbeans/xdebug 解决方案http://wjmceachran.com/articles/70-codeigniter-and -netbeans.html

于 2011-09-09T14:01:34.933 回答
3

看起来同样的问题在这里解决了。根据该问题已接受的答案,请确保您在配置文件中设置了以下内容:

$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;
于 2010-01-28T01:41:45.300 回答
2

经过一段时间的研究和测试,我发现了这篇文章。

http://brettic.us/2009/11/07/developing-php-on-a-mac-with-netbeans/

它在哪里显示和显示,并在本地服务器安装和 NetBeans 中使用带有 xDebug 的xdebug Firefox 插件,使您能够调试 Code Igniter 项目,而无需在 Code Igniter 配置设置中打开查询字符串。

实际上真的很容易使用。希望能帮助遇到同样问题的其他人。

于 2010-02-02T17:27:02.213 回答