I'm so giddy I'm giggling in my cube. I just got Visual Studio working with the WAMP stack!
I've really come to appreciate Drupal, but I just can't give up Visual Studio. I've tried Eclipse/Aptana. I didn't have much luck getting step debugging working. And then I tried Komodo. For $250, it would be worth it just to have all my Windows comfort. It worked, but I found something better.
VS.PHP is a Visual Studio addin for PHP. It uses a reflection-like (not real reflection because it's not .NET) method to look into referenced code for Intellisense. It also has a built-in Apache-based web server so it can control the debugging process.
And what a debugging process. Full breakpoints and stepping (step into and step over). Plus, it has the familiar Visual Studio real-time value checking by simply hovering over a variable during debugging. It also has the QuickWatch, where you can inspect variables and arrays.
So, set a couple breakpoints, hit F5, and step and inspect like crazy.
So for a hundred bucks, you've got a full development package. I don't know if it works with the free version of Visual Studio, but it does come with a shell if you don't have Visual Studio installed.
Warning: use version 2.7, as the 2.8 RC uses PHP 5.3.
I also downloaded the MySql connector for Visual Studio, which exposes the database in the Server Explorer. More responsive than phpMyAdmin.
If you're comfortable with the free tools, there's no need to change. But I've become spoiled by Visual Studio, and I'm glad there's a path. Plus, the book I'm writing is about integrating Drupal with back-end systems written in .NET. I should be able to develop everything in a single solution.

Comments
Drupal on VS
VS.PHP you say? It's not free, right?
But Phalanger is. I was able to run D6 on VS.2008 with it.
Though, it wasn't that smooth from the language/platform perspective (Phalanger is just a cross-compiler into CIL and tries to reuse the most of ASP.Net, which poses some restriction on what PHP program can/cannot do). But still a typical VS experience is fully achievable.
I'll give it a try
I haven't heard of/tried Phalanger, but I'll certainly give it a whirl.
I'm sort of put back by this: http://drupal.org/node/165399. Having developed with Microsoft tools for most of my career, I'm a bit put off by the concept of patching in order to just get things to load. Free is a good price, but a hundred bucks for VS.PHP was a pretty good investment just to get up and running in a couple minutes.
I have some questions on Phalanger if anyone has answers.
I suppose I will find out some of the answers to these questions if I get a chance to try out the program. I'm satisfied with VS.PHP for now, and I need to get a couple sites out the door. But I'm writing a book on Drupal integration, and I'm sure my readers would be interested in the free price point!
Brian Travis
Author, Pro Drupal 7 for Windows Developers
New Kid on the block
I just stumbled upon this offering from JetBrains. Having using IntelliJ in previous jobs (and been very impressed with it) I decided to give it a whirl. No mention of pricing yet but if you want 45 days of free IDE development and debugging...http://www.jetbrains.com/webide/index.html
John
How I did it
Here's my quick and dirty. I tried with several combinations of OS, VS, and VS.PHP, and here's what works the best for me:
I tried VS.PHP 2.8 but it does not support PHP 5.2, only PHP 5.3. The developer apparently did a lot of work on the XDebug module and it is not downward compatible to PHP 5.2
So if you are using Drupal 6, you need PHP 5.2, regardless of what people say about Drupal 6 running under PHP 5.3.
VS.PHP has its own version of Apache that is invoked like IIS is when F5 is pressed in Visual Studio. It also has its own PHP. I use WampServer for MySQL, but I also use Wamp's Apache on port 80 so I can run the site without the overhead of debugging.
The trick in this situation is to make sure the httpd.conf and php.ini of both environments are in sync.
So here's the process I used:
It'll start its web server at some random port and load the browser (probably whatever version of IE you have loaded) and break at the breakpoint. You can change it from Internet Explorer to Default Browser if you want some other browser. (Project...Properties...Debug).
So that's about it. I'm very happy with the configuration. Sometimes the VS.PHP built-in Apache server conks out and re-starts, but it really is a useable development system.
Oh, I did the same thing with Drupal 7 and it worked perfectly.
Brian Travis
Author, Pro Drupal 7 for Windows Developers
Drupal debugging on VS.PHP
Hello Brian,
First of all thank you for your book ! ;) It was very useful for me.
Now I got problem trying to debug drupal on VS.PHP. When i set startup link 'drupal' (it's a subdirectory in my localhost) I get error in browser:
"
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
"
If I set startup link to any independent php file like 'info.php' (
<?phpphpinfo();
?>
I use VS2010 and VS.PHP 2.10 for Visual Studio
Thanks in advance
marukas
.htaccess is your answer
I've seen this and actually mention it in a chapter I did for another Drupal book, The Definitive Guide to Drupal 7.
There are two probable reasons for this. One is that you don't have your MySQL server running. The other is that, for some reason, you need to comment out the line that includes "Order allow,deny" at the to of the .htaccess file in your Drupal directory.
Protect files and directories from prying eyes.
Order allow,deny
Brian Travis
Author, Pro Drupal 7 for Windows Developers
Thank you
Thank you, Brian, I've already figured out this by myself too. Now I can debug my drupal project !
Greetings
marukas
Hi brian.travis , I just got
Hi brian.travis ,
I just got your book and its really a nice boook for dot net developer who want to learn drupal in visual studio . i tried to open the drupal project with visula sutdio and its working fine after commenting the line as you told above "Order allow,deny" , i was using the built in appahce server in vs.php,
but i have wamp server and i want to use my drupal code using wamp server but I am not be able to do it ,even i was not be able to use simple php project using vs.php when i have wamp server , i also tired to contact the vs.php forum but no use.
you can check my post from there too.
http://www.jcxsoftware.com/jcx/node/3351
and when i tried to load the drupal project in vs.php using wamp i got internal error , there is a related post on this url but still no fruit.
http://www.jcxsoftware.com/jcx/node/3347
can you please tell me how to do and degbugg drupal project when using wamp server in vs.php ?
Hi Brian I've just bought
Hi Brian
I've just bought your book, after reading this thread.
I'm an old VB dude, that switched recently to php-Drupal. I was so sad to not being able to see my objects and variables anymore. (without talking about F10 F11...)I've lost so much time with dpm!
Thank you so much, you've SAVED my life. Now I can fully began to understand Drupal.
I'm so glad to find back my DataEnvironment !
Could you tell me if there is a way to deduct and see DB schema with relations, like Access does ?
Thx again.
Apache HTTP Server has stopped working
Hi Brian,
I am having problem debugging drupal. For other php project it is working good and I can debug exactly as .net project but when I try to debug drupal project, it hits the breakpoint but when I press F5, F10 or F11, Apache HTTP crashes and debugging session terminates with message:
Apache HTTP Server has stopped working
Please help me how to resolve this issue? I tried commenting Order allow, deny without success.
Thanks.
What are your thoughts on
What are your thoughts on using WebMatrix?
I just use that with the default MySQL tools, Drush for Windows, and Git and I have almost everything I need.
--James
--James
Thanks author's article
I like this style. We just try to resolve application feature ,no to make new problem.
My rule is : debugable must before develop.
Debug and visual is two real technology of our computer technology.
Any technology which to make me understand faster is good.
Beside , maybe the author is in a same condition with me that have to act several different roles by himself~
I admire those who single-mide in drupal. But I cannot~~