window 7安装 Xdebugger, Acquia Dev Desktop, and Netbeans 调试程序

I usually use linux, but for various reasons I've needed to use windows lately and so I figured I would setup Xdebug, Acquia Dev Desktop, and Netbeans in Windows.  I didn't see much for guides out there but its really pretty easy.

Step 1 - Install Acquia Dev Desktop:

You can install either the D6 or D7 one, because really they are the same and you can just add D6/7/yourflavor to it using its "import" button.

I installed this to "C:\acquia-drupal" and "C:\sites\acquia-drupal".  That way I don't have to worry about the spaces when configing my php.ini files.  Spaces in file directories always seem to cause me issues.  Like so:

 

I downloaded dev desktop from here: https://network.acquia.com/downloads

Step 2 - Install Netbeans

I just went for the php version.  Once its installed you can download any plugins you want.

Download it here: http://netbeans.org/downloads/index.html

Step 3 - Setup Netbeans

This is pretty easy, I just basically followed: http://drupal.org/node/1019816.  Some of the options shown on that url are missing in my netbeans, so I just ignored them.

Also, install whatever plugins you want (git is a good one) from W.  To do this I had to run netbeans as administrator (in windows 7), everytime after that I didnt, but to get it going the first time I had too.

Step 4 - Add your project and config it for debug

The Drupal.org link above shows you how to add a project.  One tweak I would do after you add the project, right click your project > properties > Run configuration > Advanced > Do not open webbrowser.

Step 5 - Setup PHP for xdebug.

I noticed Acquia Dev Desktop had the xdebug extension already in the "C:\acquia-drupal\php5_2\ext" folder so I didn't even have to download it.

All I did was edit my php.ini file.  I added this to the bottom:

[debug]
zend_extension_ts=C:\acquia-drupal\php5_2\ext\php_xdebug-2.1.2-5.2-vc6.dll;
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

You can find a link to your php.ini file opening your Acquia Dev Desktop Control Panel and clicking on Settings, then config tab, then the "edit" button next to the php.ini file.

After you add the above to the php.ini file, stop and start the Acquia Drupal Stack.  Now, go back into setting, config tab, and click the phpinfo link.  This will open a page where you can see if xdebug is setup and working.  If you see anything about xdebug on that page, its probably working.

Step 6 - Install the easy Xdebug plugin for FireFox

You can find this plugin here: https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/

This will put 2 little icons in your lower right of firefox, a bug-looking-thing and a green square.

Step 7 - Setup Breakpoints and debug

Boot up Netbeans, Acquia Drupal Stack, and Firefox. 

In firefox, go to the php page you want to debug. 

In netbeans, add breakpoints to where you want to stop.  Then click to the debug button in netbeans:

In firefox, click the green bug (lower right from easy Xdebug) and reload the page.

TADAAA, Netbeans will stop at the breakpoints and show you variables and such.  Very cool.

Conclusion

So there you go.  Pretty quick and easy to get up and running.  If you have any questions just let me know.  I'm not a pro at this stuff but I'll sure try and answer whatever you throw at me.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值