PHP syntax highlighting in Visual Web Developer?
U

11

6

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.

Uboat answered 3/7, 2009 at 4:11 Comment(0)
S
6

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/

Seagoing answered 7/7, 2009 at 19:56 Comment(3)
Thank you for a good answer, those first two sentences sum up what I think exactly! I was just hoping that because Microsoft was making kind of a deal about PHP integration lately, that they would have had syntax highlighting for it. Guess not. Hopefully in VS 2010 they will.Uboat
You're welcome. Don't count on direct PHP support from Microsoft. :)Seagoing
Probably should have quoted it, since the link is now broken.Bates
S
7

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.

Sweetener answered 5/7, 2009 at 5:20 Comment(0)
S
6

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/

Seagoing answered 7/7, 2009 at 19:56 Comment(3)
Thank you for a good answer, those first two sentences sum up what I think exactly! I was just hoping that because Microsoft was making kind of a deal about PHP integration lately, that they would have had syntax highlighting for it. Guess not. Hopefully in VS 2010 they will.Uboat
You're welcome. Don't count on direct PHP support from Microsoft. :)Seagoing
Probably should have quoted it, since the link is now broken.Bates
W
4

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.

Wiltz answered 20/7, 2010 at 6:11 Comment(0)
M
2

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

Maigre answered 6/7, 2009 at 17:44 Comment(0)
G
2

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

Graduated answered 25/10, 2010 at 13:56 Comment(0)
P
1

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.

Peter answered 23/2, 2012 at 17:0 Comment(0)
J
1

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.

Jinx answered 10/9, 2012 at 15:48 Comment(0)
S
0

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.

Scopophilia answered 7/7, 2009 at 19:29 Comment(0)
R
0

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.

Rumormonger answered 4/9, 2009 at 18:0 Comment(0)
N
0

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

Newsman answered 6/11, 2010 at 14:55 Comment(0)
C
0

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.

Corona answered 29/3, 2013 at 13:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.