Question

I recently installed PHP 5 on IIS, however, I am unable to find a PHP syntax highlighting plug-in or extension for VWD. Where can I find a plug-in? I thought there was an official one.

Was it helpful?

Solution

I've tried a lot of text editors, some free, some commercial. So far Visual Studio is the only one that has the right combination of features to be most useful to me. So, coding PHP in VS is important to me.

You can trick Visual Studio (and hopefully also Visual Web Developer) into thinking .php files are C++ with a registry hack. The syntax highlighting is close enough to be useful.

This blog post explains how to do it for all versions of VS: http://blog.cumps.be/visual-studio-2008-and-php-coloring/

OTHER TIPS

Consider PHP IDE for Visual Studio.

http://www.jcxsoftware.com/vs.php

I have used this and it adds a lot of nice PHP specific features to Visual Studio.

From their site...

Editor and File Management

•PHP4 and PHP5 Support

•Syntax Coloring for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT

•File templates for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT

•Intellisense for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT

Debugging

•XDebug and DBG support

•Debug PHP, JavaScript and .Net in one single session

•Built-in Apache web server for ease of debugging. Preconfigured with Php4, Php5, XDebug and DBG.

I don't know about older versions, but VWD 2010 allows you to link any extension to any type of formatting in its options.

Tools->Options

click 'show all options'

Expand 'Text editor'

click on 'file extensions'

type in 'php' and select how you want it to be formatted (I recommend the Automatic Editor Selector), click Add

And there you go! Next time you load the page you will see the changes. If you don't like it, there's 20 other styles to choose from.

There is no official plugin for PHP for Visual Web Developer. I believe that this is because Microsoft would rather you use their .NET products, (notably ASP) which serves most of if not all of (I can't exactly say as I don't really use ASP as much as PHP) of the functionality of PHP.

There are however, some very good PHP IDEs out there. A list of which you Here

thx, I use the last post with "HTML format" instead "automatic editor selector"

I would recommend using Netbeans. It has code completion for PHP and runs xdebug for debugging. I've been using it for over a year and the support for PHP just keeps getting better.

Definitely worth trying.

I would recommend Visual Studio with this Extension : http://phalanger.codeplex.com/

It is free and gives you more functionality than most of the expensive tools.

if you're using windows there's an application called notepad++ that will do syntax highlighting for dozens of languages. I used it for C but I know it has a php syntax highlighter and many more languages coming along. Check it out on sourceforge. If your using Linux or Unix you can use K Advanced Text Editor (kate). It also has a console window built in.

What I am looking is for a debugger for PHP that is as useful as the one built into Visual Studios. I searched high and low for this and there seems to be none that works well.

What I used is the PHP Designer 2007 - Personal Version 5.0.2 is a fully functional php editor, for free! from mpsoftware[dot]dk/, however I like using MSVWD a lot too, and now that I've seen how to make php files work in it, I gonna stick with that! Thanks!

btw Aptana Studio looks promising too tho

The closest Visual Studio like PHP environment I have found yet is CodeLobster. It has a free version for PHP and CSS, as well as for pay versions that include for the Pro version a plug-in for CakePHP, CodeIgniter, Drupal, Facebook, JQuery, Joomla, Smarty, Symfony, WordPress and Yii.

It isn't perfect, but it is pretty good and free for the basic version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top