These configuration steps used to reside in my Drupal Developer's Setup for Windows post. But I've since switched to Sublime Text 2 so the steps in that post changed drastically. I've archived the Eclipse/Aptana settings here, just in case they are still of use to anyone.
- Set Window –> Preferences –> General –> Editors –> Text Editor –> Displayed tab width to 2 and check the Insert spaces for tabs option
- Navigate to General –> Editors –> File Associations in the left-hand pane
- Click the Add… button next to the File types list (the top Add button) type *.module in the File type text box
- Click the Add… button next to the Associated editors list (the bottom Add button), select PHP Source Editor from the list and click OK
- Repeat steps 1 and 2 for each of these file types:
*.engine
*.inc (may already be associated with the PHP editor)
*.theme
*.install
*.profile
*.test
- When you first start Aptana, you may get a Windows Firewall alert. If so, allow access as you see fit.
- Install XDebug. Aptana finally has support for XDebug, but you’ll need to grab a build greater than 3.2.0.201203202318. Obviously this is an optional step, but if you’ve been debugging your Drupal sites with a liberal sprinkling of dsm() calls, consider doing these steps. The time saved the first time you use the debugger will make it all worth it or your money back…
- Check your Eclipse version (Help –> About Aptana Studio 3). Once Aptana 3.2 is released, this is will no longer be necessary.
- From Windows –> Preferences –> Install/Update –> Available Software Sites, click Add, point the new update site to http://preview.appcelerator.com/aptana/studio3/standalone/update/nightly/, and OK the dialog.
- Close Aptana. Right-click on the Aptana icon in the Taskbar, right-click on the AptanaStudio 3 option, and select Run as administrator. This gives Aptana permissions to update itself.
- In Aptana, Help –> Check for updates and follow the instructions for updating Aptana Studio.
- Get the debugger plugin for Aptana. Note: Once Aptana 3.2 is released, the debugger plugin should come included and these steps will no longer be needed.
- Go to this issue in the Aptana issue queue and download the zip file in the Attachments section.
- Unzip the file and place the contents in a directory on your local machine.
- In Aptana, Help –> Install new software, click the Add button, click the Local button, and navigate to the directory with the unzipped files.
- Click OK and follow the instructions to install the debugger.
- Edit your php.ini file (click the WAMP Manager icon, select PHP –> php.ini) and scroll to the XDebug section. Change/Add the following values then restart Apache. You can verify the changes by creating a one-line PHP file with <?php phpinfo(); ?> and verify that with XDebug v. 2.1.2 Copyright… etc. appears just above the PHP Credits link.
xdebug.remote_enable=1 xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_handler="dbgp"
- You can setup Debug Configurations in Aptana (Run –> Debug Configurations…), but I find it easier to use Chrome’s XDebug Helper or Firefox’s easy XDebug plugins to tell Aptana when I want to break into the debugger. I know that Chrome’s can be set so the option is only available for some sites (eg: local.*) so it’s not cluttering my day-to-day browsing. I also like remapping the keyboard shortcuts for Step Over and Step Into to F10 and F11 to match what I’m used to from other debuggers. All I have to do is set a breakpoint in my code, then go to Chrome and make sure the “bug” at the end of the URL bar is green. I navigate to a page that will trip the breakpoint, switch to Aptana and it’s already waiting for me to step through the code!
- Check your Eclipse version (Help –> About Aptana Studio 3). Once Aptana 3.2 is released, this is will no longer be necessary.