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.

2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

This is happening to me but I cannot find the file in File Types. And other solution?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.