简体   繁体   中英

Not a single PHP file is recognized as PHP file in PhpStorm

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.

在此处输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM