0

In PhpStorm the latest version (2018), so it was in version 2017 in the project, I have a file called User_model.php and PhpStorm does not recognize it as a PHP file, it recognizes it as a plain text file.

But it was not always so; I only recently noticed.

I realized that the problem is in the name of the file (User_model.php). Because as soon as I change the file names (for example, Users_model.php), the file is immediately recognized as a PHP file.

Is it (User_model.php) some reserved name and it cannot be used?

I didn't mark file as "Mark as Plain Text".

This problem is present in all projects in my PhpStorm.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • 3
    **Always** add screenshots. It will simplify things a lot. But so far: https://stackoverflow.com/a/21281563/783119 or https://stackoverflow.com/a/22709627/783119 or https://stackoverflow.com/a/49439872/783119 -- same story/solution. – LazyOne May 10 '18 at 17:35
  • @LazyOne thank you! the second link helped – Shuhratjon Jumaev May 10 '18 at 17:42

1 Answers1

4

This happened to me with a single file that I initially created with the name myfile instead of myfile.php. I found help here: Wrong syntax highlighting for PHP file in PHPStorm

Going into Preferences / Editor / File Types, I found myfile listed as a Registered Pattern in both the PHP Recognized File Type and the Text Recognized File Type. When I deleted both of these, myfile.php highlighted properly.

lisajwells
  • 56
  • 4