Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have php code written in file but dreamweaver is showing no color highlighting.

Is there any way to make them same color code as .php extension

share|improve this question
up vote 10 down vote accepted

You'll have to add the .inc extension to MMDocumentTypes.xml. You haven't indicated what version of Dreamweaver you're using, or your operating system, so I'll have to guess Windows is your OS from your other questions.

On Windows 7 and Vista, the file is located at:

C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS4\configuration\DocumentTypes\MMDocumentTypes.xml

and on XP:

C:\Program Files\Adobe\Adobe Dreamweaver CS4\configuration\DocumentTypes\MMDocumentTypes.xml

After opening the file, search for PHP. You'll come across this block:

<documenttype id="PHP_MySQL" servermodel="PHP MySQL"
internaltype="Dynamic" winfileextension="php,php3,php4,php5"
macfileextension="php,php3,php4,php5" file="Default.php"

Now add the .inc extension into the winfileextension (and macfileextension to be safe):

<documenttype id="PHP_MySQL" servermodel="PHP MySQL"
internaltype="Dynamic" winfileextension="php,php3,php4,php5,inc"
macfileextension="php,php3,php4,php5,inc" file="Default.php"

save this file, exit, and restart Dreamweaver.

share|improve this answer
thanks buddy it worked – Mirage Mar 3 '10 at 6:32
+1 this also worked for me for CS5 and ctp files. – JD Isaacks Nov 17 '10 at 16:22

As of CS5.5 on Windows 7 the file exists twice. Once in the location mentioned by John T, but also in:

c:\Users\USERNAME\AppData\Roaming\Adobe\Dreamweaver CS5.5\en_US\Configuration\DocumentTypes\

If you dont change this file, the color coding won't work.

share|improve this answer

Since this is a problem across a wide array of applications, the easiest solution I found was just to rename the files in question to this format:

And then for security purposes to prevent direct access, I usually add this in my htaccess files:

# To prevent direct access to included files
<Files ~ "\.(inc\.php)$">
  Order allow,deny
  Deny from all
share|improve this answer
if you want to prevent direct access, why not just put the files outside your www root and include from there? – eis Nov 1 '12 at 9:19
If you have a webapp or distributable webapp, it simply isn't practical. In any case, other methods to prevent direct access use PHP code instead of htaccess rules. – Force Flow Nov 1 '12 at 16:17

In CS5, you can't have duplicates of your entry in the XML (if the extension is already assigned to another file type, so check/remove any duplicate you don't want otherwise there will be an errors when starting Dreamweaver. In addition, you also can't save a backup XML in the folder using the same name (like "MMDocumentTypes_BU.xml"). Dreamweaver will try and read both files, you will get errors having duplication extensions entered.

share|improve this answer

You have to put ',inc' in the Adobe Dreamweaver CS4\configuration\Extensions.txt file as well for CS4. Once in the top line and once in the coldfusion line. (after cfc)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .