Last updated July 24, 2015. Created on November 21, 2012.
Edited by stargazer1sd, LennyB, densolis, a.milkovsky. Log in to edit this page.

Because all the following information is available online in different places, I thought it might be helpful to others running Acquia Dev Desktop on Windows to have a a one-stop tutorial for setting up NetBeans/Xdebug/Drupal Development tools and templates.

Note:These instructions have been tested using Netbeans 7.2. as other use this document on other versions, please update this line. Thanks.

You can download, install and configure Acquia Dev Desktop for Windows here:

1. Firefox

  1. Download/install Firefox
  2. Install FF extension Easy Xdebug
  3. Once installed, click on View -> Toolbars -> Check Add-on Bar - a "status line" will appear at the bottom of the firefox screen. Should be two icons for Easy Xdebug in the right hand corner of the Add-on Bar.

2. Xdebug


  • Install Acquia Dev Desktop
  • Click the Acquia Dev Desktop > Preferences.
  • On the Config tab, under Stack configuration files, choose the version of PHP your project uses and click "Edit". This opens the php.ini file.
  • Look in C:\Program Files (x86)\DevDesktop\php5_3\ext and find the file starting with php_xdebug. It will likely be in the form of php_xdebug-2.2.4-5.3-vc9.dll
  • Search for a line that contains and uncomment it by removing the ; (semicolon) at the beginning of the line. For example: zend_extension="/Applications/DevDesktop/php5_5/ext/"
  • Change in the line you found above to the file name in the previous step.
  • Scroll to the very bottom and add this: xdebug.remote_enable=1
  • Save the php.ini file.
  • Stop and restart Apache in Acquia Dev Desktop to ensure that the configuration change takes effect.
  • You can confirm that Xdebug is enabled by visiting the Drupal phpinfo() page (/admin/reports/status/php) and checking that the Xdebug extension appears in the list of extensions.


2.2.1 Get the Xdebug file

  1. Download
  2. Move the downloaded file to
  • XP: "C:\Program Files\acquia-drupal\php5_3\ext"
  • W7: "C:\Program Files (x86)\acquia-drupal\php5_3\ext"

NOTE - You will need to remember this path.

2.2.2. ACQUIA DEV DESKTOP - set up PHP.ini for xdebug

  • Using Acquia Dev Desktop - create a clean install site (just need to have single site set up and running).
  • Click the Settings button.
  • On the Config tab, under Stack configuration files, choose the version of PHP your project uses and click "Edit". This opens the php.ini file.
  • Scroll to the very bottom and add this:
zend_extension="C:\Program Files\acquia-drupal\php5_3\ext\php_xdebug-2.2.1-5.3-vc9.dll"

* zend_extension is the path to your acquia-drupal install's php/ext folder with the .dll file needed. See STEP 2 above.

  • Save the file.
  • Restart the webserver.

3. NetBeans and Drupal Dev Tools/Template

3a. Download/install NetBeans IDE

I went for PHP version.

3b. Download the file NBDRupalDevelTool.nbm from GitHub

3c. Download nb_templates from:


  • Win7 - unzip to C:\Users\\documents\
  • WinXP - unzip to C:\Documents and Settings\\My Documents

The unzip will place the files in a directory call nb_templates. Inside that directory find and rename to

3d. Start up NetBeans and go to Tools -> Plugins

  • Inside the plugins dialog click the Downloaded tab.
  • Click the “Add Plugins” button and browse to the NBDrupalDevel.nbm you downloaded in step 4b.
  • Check the box next to the Drupal Developer item and click the Install button.
  • Proceed through the installation screens.

You will get a message the says certification is not trusted. Click proceed. You will also get error message saying Drush was not found. Click OK - we will setup at a later point.

  • Click Finish and close.

Once installation is complete, restart NetBeans for the module to fully take effect.

4. Configuring NetBeans for Drupal

Configuring NetBeans - changes from default installation settings

Tools -> Options
General Tab
Web Browser - change to Firefox if FF is not your Default System Browser
Editor Tab
General subtab:
Uncheck Enable Camel Case Navigation
Remove Trailing Whitespace - Always
Formatting subtab:
Change Language to PHP in Langauge drop down box

Change Category: Tabs and Indents
Uncheck "Use All Language Settings"
Check Expand tabs to Spaces
Number of Spaces per Indent: 2
Tab Size: 2
Continuation Indentation: 4
Array Declaration Indentation: 2

Change Category: alignment
New Lines; check "else", "elseif"

Hints subtab:
Change Language to PHP in Langauge drop down box
Uncheck all Experimental check boxes.

Fonts & Colors
Versioning subtab:
Select preferred (installed) Versioning Systems - Git, Subversion and Mercurial are all installed.

Note: Explore the Keyboard map - no changes - but very helpful if you are new to netbeans. this is all of the keyboard short cuts.

General subtab WinXP only
Open Result In: Output Window
PHP 5 Interpreter: if there is anything in this field, remove it

Debugging subtab Win7: (or General subtab Win7 - version dependent)
PHP 5 Interpreter: if there is anything in this field, remove it
Check Open Result In: Output Window
Debugger Port: 9000
Session ID: netbeans-xdebug
Stop at First Line: should be checked

Debugging subtab WinXP:
Debuger Port: 9000
Session ID: netbeans-xdebug
Stop at First Line: should be checked

Drupal subtab
Browse to the nb_templates folder downloaded/unzipped in step 4c.
Set Default Drupal Version to either 6 or 7
Browse to your drush installation
Windows 7 = C:\ProgramData\drush
WinXP = C:\Documents and Settings\All Users\Application Data\Drush

Miscelaneous Tab
Files subtab: Associate drupal file extensions with MIME types.
Click New on the Files tab. Add the following extensions one by one:
File Extension MIME Type
engine PHP Files (text/x-php5)
install PHP Files (text/x-php5)
module PHP Files (text/x-php5)
profile PHP Files (text/x-php5)
test PHP Files (text/x-php5)
theme PHP Files (text/x-php5)

info text/plain
po text/plain

Javascript subtab:
Targeted browsers (check all):
Firefox/Mozilla 2.x and later
Internet Explorer 7 and later
Safari 2 and later

Close Options window

Go to Window -> Drupal -> Drupal API
This opens a pane in NetBeans with 2 folders: hooks and themes
If you click on hooks, it will show you all of the hooks - will hook into your code. Position cursor in code, switch to hook fold, find the one you want, and click on it - hook will be inserted into your code. If you click on themes, it will show you the theme info

5. Create a new Project in NetBeans

  • Go to File -> New project
  • Choose PHP -> PHP Application With Existing Sources, click next
  • Sources Folder: browse to the root of the drupal installation created in Acquia Dev Desktop above (NetBeans debugging requires the index.php for the project).
  • In Acquai Dev, in Win7 this file is located at "C:\Users\\Sites\acquia-drupal"
  • In WinXP this file is located at "C:\Documents and Settings\\Sites\acquia-drupal"
  • Click next
  • Change Project name as you like,
  • Verify php is 5.3
  • Click next
  • Click Finish

If the import worked correctly, you should see directory structure in the left pane.

6. Set up the project properties

  • Right click on the project name in the left pane and choose Properties
  • Click on Run Configuration in the left pane of the Project Properties window
  • Click the Advanced button
  • Select the radio button "Do Not Open Web Browser"
  • Click Ok
  • Click on Window -> Drupal -> Drush (do this once and should happen from then on)

7. Ok, FINALLY, let's try debugging...

Open a .module file from the project's list on the left.


Code execution in debugging mode is always interrupted by breakpoints. You can set a breakpoint anywhere in your code by clicking on the line number, which will highlight the line red. You can also set breakpoints by right clicking on the line and selecting "Toggle Line Breakpoint".

With a breakpoint in place you can run the code in debug mode as normal, but when a breakpoint is reached the code will stop at that point. The code execution stops at the beginning of the line, so the contents of the line are not executed until the code is either continued or stepped onwards.

In Firefox, navigate to the selected module's page, then click the little green icon in the bottom right of the screen. There are two icons, click on the left one:

  1. left = Start Xdebug Session
  2. right = Start Xdebug Profiler

You'll see it now has a little red square in the corner of the icon.

In NetBeans, click the Debug Project icon in the toolbar (last icon on right in the tool bar). Note: In the bottom right of the NetBeans window, you'll see "Waiting For Connection (netbeans-xdebug)". Once it has connected, you will get new Debug icons to the right of the Debug Project icon. Also, the pane below will also provide Variable, Call Stack, Break points, and Drush. Nothing will appear until you refresh your Firefox page.

Back to Firefox, refresh the page and NetBeans should open in front. The debugger will stop on first line of index.php, because we told it to stop on the first line in Step 5 above. Click F5 (or the Continue icon in the toolbar) - and it should run through to your breakpoint, outputting all the Variables and Call Stack for inspection in the panes below the code and alongside the Drush pane.

Problems setting up Xdebug

Copy SCREEN output and paste into wizard here:

Other links:

Video - Drupal Development Tool for Netbeans:
Debugging PHP Source Code in the NetBeans IDE:
How to configure XDebug in Netbeans
Configuring PHP Development Environment in Windows


Drupal Development Tool For NetBeans 7 (
Configuring Netbeans (

Looking for support? Visit the forums, or join #drupal-support in IRC.


DominiqueGijzen’s picture

Great Help. Tnx.

Minor typo which might be a problem for newbies:

General subtab WinXP only
Open Result In: Output Window
PHP 5 Interpreter: if there is anything in this field, remove it

General subtab Win7:
PHP 5 Interpreter: if there is anything in this field, remove it
Check Open Result In: Output Window
Debugger Port: 9000
Session ID: netbeans-xdebug
Stop at First Line: should be checked

Debugging subtab WinXP:
Debuger Port: 9000
Session ID: netbeans-xdebug
Stop at First Line: should be checked

Second alinea should be "Debugging subtab Win7" instead of "General subtab Win7".

densolis’s picture


Per your request, I made the change. Just out of curiosity, which version of Net Beans are you running? I'm running 7.2 and I did not see the title you saw.



cdykstra’s picture

Glad it helped. please see densolis' comment on the typo.

sprklinginfo’s picture


cdykstra’s picture

Glad it was useful!

sparky888’s picture

Thanks for the great tutorial! I've reviewed this and a few other resources, but have a few questions regarding the directory structure for this dev setup.

I'm trying to set it up to be used by multiple users, so I'm trying to avoid putting files into User directories.

These are the tools I'm using:

Acquia Dev Desktop
>>Built-in Drush

Is it possible to set up such a directory structure?

C:\Dev_Server\acquia-drupal - for wamp stack (apache, mysql, php, drush)
C:\Dev_Server\Dev_sites - main Drupal directory with subdirectory for multiple sites (Dev_sites/sites)

Then install applications as follows:

C:\Program Files (x86)\NetBeans
C:\Program Files (x86)\Git

It seems to be working OK, but other than feedback on this structure, I need to know if NB project folders would be OK in the main Drupal directory?

How do other people do this? Do they have projects in a different directory and transfer files into the Drupal directory for testing on the local server?

Any feedback would be greatly appreciated!

AbbyG88’s picture

Hello. Awesome instructions! Thanks so much for putting all this information together.

One note: I initially kept getting "waiting for connection" in Netbeans after pressing the Firefox "Start xdebug session" and then pressing the Netbeans "Debug Project" button. It just wouldn't connect. I finally worked it out that after I press the Firefox "Start xdebug session", then press the Netbeans "Debug Project" button, I need to refresh the Firefox page. If I don't refresh the page at that point, Netbeans just hangs on "waiting for connection" indefinitely.

Thanks again for a super set of instructions!

hosais’s picture


I spent lots of hours to figure out the solution. I change many settings combinations and still it did not work. Finally, I just open the 9000 port by windows firewall then no more waiting ... hahaha

The second thing: be careful the versions of xdebug dll files. My windows is 64bit but finally 32 bit works. (maybe I installed 32bit netbeans, I am not sure).