我想知道如何让 XDebug 与 Aptana Studio 3 一起工作(我已经在这台机器上使用 XAMPP 安装了 Aptana Studio 3)。
你知道最近有一篇文章告诉我如何做到这一点并解释 XDebug 吗?我对 XDebug 没有经验也没有任何知识,我找了一些文章,但对我来说似乎都过时了。
我意识到这是一个旧线程,但我也很难找到如何使用 Aptana Studio 和 FireFox 调试 php,所以这里有一个快速的方法来让它工作......
我发现最简单的方法是安装 wamp server V2.2,这是一个非常有用的程序,因为它安装了 Apache Server、PHP 和 MySQL 等工具,一切都可以通过任务栏轻松配置。
1.) 安装 Aptana Studio V3.3.X或更高版本在此处下载
2.) 安装 WampServer V2.2 或更高版本在此处下载(XAMMP 用户阅读底部)。
WampServer:
1.) 确保 XDebug 正在接受远程调试,单击任务栏中的 WampServer 图标并转到 PHP->PHP 设置并确保选中“(XDebug):远程调试”,如果没有选中它,请单击 WampServer 图标和“重新启动所有服务”。
2.) 验证 XDebug 是否正在运行: a.) 如果您让 WampServer 插入 index.php,在 URL 中输入“localhost”并在“工具”下单击“phpinfo()”并检查以确保 XDebug 正在运行,您应该会看到Firefox 中的以下内容:
b.) If you didn't overwrite the index.php create a file (/www_dir/phpinfo.php) with the following:
<?php
phpinfo();
?>
b.1) In FireFox enter "localhost/phpinfo.php" and look for XDebug as shown in the previous image.
阿普塔纳工作室:
1.) Click Window->Preferences
2.) In the Preferences dialog go to Aptana Studio->Editors->PHP->PHP Interpreters
3.) Click "Add..."
4.) Enter the information like
5.) Click "OK"
6.) Click on the debug icon and select "Debug Configurations"
7.) Double click on "PHP Web Page"
8.) Click the plus next to "PHP Server"
a.) Enter a name
b.) Base URL will be "localhost"
c.) Document Root will be the path to your index.php
最后在 Aptana Studio 中单击调试图标箭头并选择您在上面命名的配置。如果 Firefox 提示您安装 Aptana Studio 插件...
希望这有助于...
XAMPP 用户
按照提供的步骤操作,但您的目录链接在
在首选项对话框中,转到 Aptana Studio->Editors->PHP->PHP Interpreters
应该分别链接到 C:\xampp\php\php.exe 和 C:\xampp\php\php.ini
***** 更新 *****
如果您使用的是 Firefox V20+,那么与 Firebug V1.8+ 存在一些兼容性问题,这基本上会破坏 Firefox 的上下文菜单,我找不到解决方法,所以我最终不得不走另一条路,并认为我应该发一个帖子,Aptana Studio 基于 Eclipse,因此恕我直言,获得 PHP 调试的最佳方法是使用 PDT 安装 Eclipse 并删除 Aptana Studio ......上述说明将有助于让一切与 XDebug 一起工作
这是关于如何启动和运行eclipse-pdt的一个很好的链接
At the moment, there is no PHP debugger support in Aptana Studio 3. However, there will be soon. See: http://jira.appcelerator.org/browse/APSTUD-769 and add yourself as a watcher to get informed when it's done.
For now, you can install PDT from eclipse.org if you really need to debug. They also provide up-to-date docs on how to use it. There is a small learning curve, but it will work pretty much the same in Aptana (once it's released), so you have nothing to lose :)
假设您已经在系统上安装了 xdebug,这里是一个迷你的如何配置和开始使用 XDebug 和 Aptana Studio 3.3。(在 Ubuntu/Linux 中它只是一个sudo apt-get install php5-xdebug
)。
配置调试器
在首选项->Aptana Studio->PHP->PHP Interpreter 单击添加...,并指定名称、php 可执行文件(大多数 Linux 发行版中的 /usr/bin/php)、php.ini(/etc/php5 /conf.d/20-xdebug.ini 在我的系统上),并将 XDebug 留在 PHP 调试器的选择字段中。
使用调试器
制作一个 php 文件并在其中放入一些代码:
<?php
$defined_var = 'some value';
echo $defined_var;
echo $undefined_var;
exit();
?>
保存并按 Run->Debug As->PHP Script 会提示您切换 Workspace。
通过在行号旁边双击来指定行断点,例如在 exit() 函数的行处。按 Resume(F8) 可以看到 Debug Current Instruction Pointer 移到了那里。
在变量选项卡中,您现在应该看到哪些变量具有某些值或它们未初始化。可以在控制台选项卡中找到输出。
再次按恢复将终止调试。
当然,这只是调试的冰山一角,但这只是一个开始。
还有许多其他选项可供探索以及调试脚本的方法。
I have use Aptana Studio 3.2.2 to develop my Drupal site and use XDebug to debug the project. The Aptana Studio supports xdebug. You need to follow some steps to enable xdebug in Aptana Studio.
You can find a details step by step procedure in the following link: http://devcircle.blogspot.com/2013/02/enable-xdebug-in-aptana-studio-3x.html
Hopefully it helps to solve the problem.
对我来说,它只有在 1. 从这里执行东西(基本上 - 设置 XDebug 以进行远程调试) https://jira.appcelerator.org/secure/attachment/26404/ScriptPHPDebugging.pdf 2. 安装“XDebug helper”之后才起作用" 对于 chrome,对于 FF 类似。
之后,我的远程会话就像他们在 Eclipse 中所做的那样工作。