使用 Eclipse 和 xDebug 在浏览器上调试 PHP 文件

发布于 2024-10-29 13:48:02 字数 260 浏览 7 评论 0原文

我一直在网上阅读有关 Eclipse 和 xDebug 上的开发人员使用 PHP 进行调试的内容。 我已经为Xdebug安装了所有必要的文件,现在,当我在Eclipse中时,我可以使用脚本运行调试器,而且工作正常。

问题是我在我的 Windows 机器上使用 AppServ(Apache、PHP 和 MySQL),我想做的是当我在浏览器中加载 PHP 页面(而不是运行它们)时在 Eclipse 中调试我的 PHP 文件如日食中的脚本)。

这可能吗?

乔尔

I have been reading online about debugging with PHP for Developers on Eclipse and xDebug.
I have installed all the necessary files for xDebug, and now when I am in Eclipse I can run the debugger with a script and it works just fine.

The issue is that i am using AppServ (Apache, PHP and MySQL) on my Windows machine, and what I would like to do is to debug my PHP files in Eclipse when I am loading the PHP pages in my browser (instead of running them as scripts in Eclipse).

Is that possible?

Joel

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

故事还在继续 2024-11-05 13:48:02

在 Eclipse 中,转到“首选项”,然后转到“PHP”、“调试”、“已安装的调试器”、“XDebug”,然后转到“配置”

在 Eclipse 中,依次转到“首选项”、“PHP”、“调试”、“已安装的调试器”、“XDebug”,然后“配置”

对于“接受远程会话”,将其更改为“localhost”

这将告诉 Eclipse 中的 XDebug 进行调试每当有人连接 xdebug cookie 或设置 URL 参数时 - 将其与 Easy Xdebug 一起使用xDebug Helper 使在现实的浏览器内上下文中进行调试变得轻而易举。

我假设您有 Eclipse PDT,否则我不确定步骤是否不同。

In Eclipse, go to 'Preferences' then 'PHP' 'Debug' 'Installed Debuggers', 'XDebug', then 'Configure'

In Eclipse, go to 'Preferences' then 'PHP' 'Debug' 'Installed Debuggers', 'XDebug', then 'Configure'

For 'Accept remote session' change this to 'localhost'

This will tell XDebug in Eclipse to debug whenever anyone connects with xdebug cookies or URL params set - using this with Easy Xdebug or xDebug Helper then makes debugging from realistic in-browser contexts a doddle.

I'm assuming you have Eclipse PDT for this, I'm not sure if the steps are different otherwise.

不喜欢何必死缠烂打 2024-11-05 13:48:02

我不确定这是否是您所要求的,但您可以看一下并决定。

使用 Firefox 轻松进行 Xdebug https://addons.mozilla.org/en-美国/firefox/addon/easy-xdebug/

I'm not sure if this is what you ask for, but you can take a look and decide.

Easy Xdebug with Firefox https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/

梦罢 2024-11-05 13:48:02

在 Ooodles Technologies,我们广泛使用 PHP,希望这个答案有所帮助。

打开 php.ini 文件后,添加以下行:

注意:(php.ini 文件同时包含在 apache 和 php 文件夹中,建议配置 apache 文件夹中存在的文件)

<span style="font-size:16px;"><span style="font-family:arial,helvetica,sans-serif;">zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll"(use zend_extension_ts as variable name if you are using php version below 5.3)
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
</span></span>

之后,确保文件系统中存在“c:/wamp/tmp”,如果不存在则创建该目录。

然后重新启动您的 apache 服务。

最后,打开 NetBeans 或 eclipse IDE 并在设置中配置 xdebug。

我希望你觉得它有用。

Here at Oodles Technologies, we work with PHP on an extensive basis and hope this answer helps.

After opening your the php.ini file, add the following lines:

Note : (php.ini file contains in both the folders that is apache and php, it is advisable to configure the file which is present in apache folder)

<span style="font-size:16px;"><span style="font-family:arial,helvetica,sans-serif;">zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll"(use zend_extension_ts as variable name if you are using php version below 5.3)
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
</span></span>

After this, Make sure that "c:/wamp/tmp" exist in file system, if not then create that directory.

Then Restart your apache services.

Lastly, open your NetBeans or eclipse IDE and configure xdebug in settings.

I hope you find it useful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文