XDebug with Aptana Studio 3
Asked Answered
B

5

17

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 XDebug, i looked for articles but all seem outdated to me.

Blumenfeld answered 28/7, 2011 at 14:39 Comment(0)
H
13

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:

XDebug

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 

this

  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

Heliogravure answered 11/2, 2013 at 21:11 Comment(0)
W
7

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 :)

Winny answered 3/8, 2011 at 20:23 Comment(2)
Now supported on nightly version of Aptana jira.appcelerator.org/browse/APSTUD-769Information
Yep! I put it there for you to try out and provide us with feedback, so please do! :)Winny
V
3

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.

Vinyl answered 1/1, 2013 at 19:8 Comment(0)
F
2

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.

  1. Configure xdebug in your php engine properly.
  2. Edit the preference by going Preference -> Aptana Studio -> Editor -> PHP Interpreter.
  3. Add a PHP interpreter and save it.
  4. Now create a new Web Server if no web server is currently working.
  5. Now Apply the changes.
  6. Next, Edit the Debug Configuration using Run -> Debug Configurations -> PHP Web Page.
  7. Add a new web page by selecting a initial script file for the php project.
  8. 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.

Fermin answered 22/2, 2013 at 14:12 Comment(0)
A
0

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.

Antilogarithm answered 5/11, 2013 at 10:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.