No syntax highlighting

I have the full IntelliJ package but seeing as it includes PHPstorm I hope this forum is most relevant.

I've started messing around with PHP a bit but  I don't get any syntax highlighting. I'm using the Darcula theme.

For instance:

<!DOCTYPE html>
<html>
<head>
    <title>PHP Meuk</title>
</head>
<body>

<?php
    echo "Hello World!";
    $variableName = "MyName";

?>


</body>
</html>



Is all one color apart from the title "PHP Meuk"

I opened an HTML file in a new project and renamed it to a .php file.

I checked Settings | File Types (under IDE settings)  and .php is listed under the HTML files.

Anyone any idea how I could solve this?

Thanks a lot in advance!

Does anyone have any idea how I can get syntax highlighting working?
3 comments

Intellij.JPG

It must be a borked setting, seeing as it's mixing colors now :) the <?php opening tag is one color and the ?> closing one another.

0

Hi there,

If you look at the icon this file has, it tells that this file (or maybe even all php files) is associated with HTML file rather than PHP.

To "fix" it:

  • Settings | File Types
  • Check patterns that assigned to "HTML files" and remove unwanted (depends on what you will have there, you may need to assign some of them back to PHP files)


If unsure -- post screenshots of Settings | File Types -- for both "HTML files" as well as "PHP files"

0

Thank you so much for your quick answer. Fixed!

0

Please sign in to leave a comment.