Home > other >  Not a single PHP file is recognized as PHP file in PhpStorm
Not a single PHP file is recognized as PHP file in PhpStorm

Time:01-21

I really don't know what could cause such a strange behavior from mentioned editor. Literally all project files with .php extension are recognized as... text files I suppose. I know that stuff like that happens when the extension is forgotten during making of a PHP class for example, but I cannot explain why this appended to all files in the project.

I know that I can change file type of each individual class, but I'm doing a Laravel project and I can't manually change file type of every single default PHP class each time when I start a new project and each time I myself add a new class.

Is there any setting which defines rules for certain file types, since changing file types of every individual project file isn't a solution? At least, not viable one.

enter image description here

CodePudding user response:

Every language is associated with one or more file extension patterns within the IDE.

Open File > Settings and then search for File Types and look for PHP in this case. There will be a list of Registered Patterns associated with PHP.

Ensure that *.php is in that list, or add it if it is missing.

  • Related