XDebug with Aptana Studio 3
I would like to know how i can get XDebug work with Aptana Studio 3 (I already have Aptana Studio 3 on this machine with XAMPP).
Do you know a recent article telling me how to do this and explains XDebug? I have no experience nor any knowledge about 开发者_StackOverflow社区XDebug, i looked for articles but all seem outdated to me.
I realize that this is a old thread but I also had a difficult time finding out how to debug php with Aptana Studio and FireFox so here is a quick how-to to get it working...
The easiest way I found is to install wamp server V2.2, this is a very useful program as it installs Apache Server, PHP and MySQL and other tools, everything can be easily configured via the taskbar.
1.) Install Aptana Studio V3.3.X or higher Download here
2.) Install WampServer V2.2 or higher Download here (XAMMP users read bottom).
WampServer:
1.) Make sure XDebug is accepting remote debug, click on the WampServer icon in the taskbar and go to PHP->PHP Setting and make sure that "(XDebug): Remote debug" is checked if not select it click on the WampServer icon and "Restart all services".
2.) Verify that XDebug is running: a.) If you had WampServer insert index.php enter "localhost" in the URL and under "Tools" click "phpinfo()" and check to make sure XDebug is running, you should see the following in 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.
Aptana Studio:
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
Finally in Aptana Studio click the Debug Icon Arrow and select the configuration you named above. If Firefox prompts you install the Aptana Studio plugin...
Hope this helps out...
-------------
XAMPP USERS
-------------
Follow the steps provided but your directory link in the
In the Preferences dialog go to Aptana Studio->Editors->PHP->PHP Interpreters
should link to C:\xampp\php\php.exe and C:\xampp\php\php.ini respectively
***** UPDATE *****
If you are using Firefox V20+ there are some compatibility problems with Firebug V1.8+ that basicly breaks Firefox's context menus, I could not find a fix for it so I ended up having to go another route and figured I should make a post, Aptana Studio is based on Eclipse so the best way IMHO to get PHP Debugging is to install Eclipse with PDT and remove Aptana Studio... The above instructions will work to get everything working with XDebug
Here is a nice link on how to get everything up and running 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 :)
Here is a mini how-to configure and start using XDebug with Aptana Studio 3.3, assuming you have installed xdebug on your system. (In Ubuntu/Linux it's just a sudo apt-get install php5-xdebug
).
Configure the debugger
In preferences->Aptana Studio->PHP->PHP Interpreter click on Add..., and specify a name, the php executable(/usr/bin/php in most Linux distributions), the php.ini(/etc/php5/conf.d/20-xdebug.ini on my system), and leave XDebug in the select field of PHP debugger.
Using the debugger
Make a php file and put some code in it:
<?php
$defined_var = 'some value';
echo $defined_var;
echo $undefined_var;
exit();
?>
Save it and press Run->Debug As->PHP Script and you will be prompted to switch Workspace.
Specify a Line Breakpoint by double clicking next to a line number, for example at the line of exit() function.
Press Resume(F8) and you can see that the Debug Current Instruction Pointer moved there.
At the variables tab, you should now see which variables have some value or they are uninitialized. The output can be found at the console tab.
Pressing resume again will terminate the debug.
Of course, this is only the tip of the iceberg regarding debug, but it's a start.
There are many other options to explore and ways to debug your scripts.
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.
- Configure xdebug in your php engine properly.
- Edit the preference by going Preference -> Aptana Studio -> Editor -> PHP Interpreter.
- Add a PHP interpreter and save it.
- Now create a new Web Server if no web server is currently working.
- Now Apply the changes.
- Next, Edit the Debug Configuration using Run -> Debug Configurations -> PHP Web Page.
- Add a new web page by selecting a initial script file for the php project.
- In the last step, start debugging.
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.
For me it worked only after 1. Performing stuffs from here (basically - setting-up the XDebug for remote debugging) https://jira.appcelerator.org/secure/attachment/26404/ScriptPHPDebugging.pdf 2. installation of "XDebug helper" for chrome, and something similar for FF.
After that I have my remote sessions working just-like-they-did-in-Eclipse.
精彩评论