Hello!

It was updated recently to the 6th version of the storm, and noticed that the php highlighting from html files had disappeared somewhere.

alt text

How can I fix this?

  • in the theme settings for html there is no, like, nothing about php - iamsalnikov
  • yes, storing php in html is a bad practice - the server can give the source code without processing, you can tell everyone who wants to generate the template generation logic. At least deny access to the directory where it all lies. - Alexey Prisyazhnyy

3 answers 3

In Settings - File Types, select Recognized File Types: PHP files (PHP) and in Registred Patterns add * .html (the template is reassigned from HTML Files). Then PHP backlight will work in HTML files (just checked).

Links one and two .

    PhpStopm 9 :

    Settings - Editor - File Types . We will see two windows:

    1. Recognized File Types
    2. Registred patterns

    In the Recognized File Types window, select the php file ? and click on it. In the second window of Registred Patterns , click on the green plus and in the opened window we register such *.html . Add this and the OK button.

    Now php code will be highlighted in html pages.

      Can you help with a similar question, there are .php files, sometimes there is a structure of the form

       <script type="text/javascript"> // ... </script> 

      However, when you want to comment out something, for example, PHPStorm comments the code inside these tags as usual html, i.e.

       <!-- --> 

      instead

       // 

      And of course there is no autocompletion in js.