PHP Tools for Visual Studio, a real alternative or not?

Eric Herlitz picture Eric Herlitz · Feb 5, 2013 · Viewed 20.2k times · Source

I am a long time developer mixing languages back and forth. The past few years I've mainly been working with .NET and Visual Studio. Whenever I write something in PHP I tend to work with NetBeans IDE (on my mac) and have always been satisfied with the general functionality, the IntelliSense and the included PHPDoc functionality.

And there I am. I really like VS but now it looks like I'm going to do some php-coding again.

Is PHP Tools for Visual Studio a real option when building enterprise-like frameworks?

If not, shall I continue with NetBeans or would that mainly indicate that I'm an old grumpy fart who's afraid of everything new?

I've read some opinions on Jetbrains php ide but the likings have been mixed, there are also many that seem to like zend but as I figured it it's best when you are using the zend frameworks which is a bit of a problem since I create my own frameworks.

It is a bonus if the IDE can run PHP 5.3 and use the build in webserver for real time debugging. Or are there any other strategies on this I should be aware of?

Answer

Dwayne Driskill picture Dwayne Driskill · May 8, 2013

I use PHP Tools for Visual Studio and I really like it. Mainly because I am primarily an asp.net developer and I feel most comfortable in Visual Studio. It's great that it I can use TFS within Visual Studio to manage my php files. It's also nice that some of the generic CodeRush features work (such as dropping markers). I've found their support to be good. It costs money, but it's reasonable.

To get server side debugging working, follow the steps here: http://xdebug.org/docs/install .
In Visual Studio, you can get to the PHP tools options from the Tools menu. Tools-Options-PHP Tools.

One thing to be aware of is which php.ini file is being used: IIS uses this php.ini:
%ProgramFiles%\PHP\v5.3\php.ini
This php.ini gets used when you debug from Visual Studio:
%ProgramFiles%\IIS Express\PHP\v5.3\php.ini

I'll mention one more thing since it was a pain to figure out; I have to debug code in the WordPress functions.php file. To get debugging working on functions.php, I first start the VS debugger (by clicking Debug-Start Debugging) on a small test file like this:

<?php
   phpinfo() ;
?>

With the debugger running, breakpoints will then be hit in functions.php. Be aware that debugging WordPress like this will only work in your default browser.