Search code examples
idephpstorm

PhpStorm header.php file is greyed out


I'm using PhpStorm and for some reason in all of my projects the header.php file got messed up. It's just greyed out and PhpStorm doesn't recognize the PHP in the specific files named header.php. The rest is working fine.

enter image description here

It's driving me crazy and I can't figure it out. I already checked file templates, reset it to default. Nothing helps.

I would appreciate any solution, thanks.


Solution

    1. Go to Settings/Preferences | Editor | File Types
    2. Locate Text entry in top table
    3. Locate and remove header.php (or very similar one) pattern from bottom table and remove it.

    Right now you have somehow told IDE to treat such file as Plain text and it does it for all files named header.php regardless of their location (quite likely it happened when you were creating new header file and forgot to enter .php part).