1

I'm using JetBrains PhpStorm as my IDE, I absolutely love it but will sadly need to change to Adobe Dreamweaver because of one problem.

I have a rather annoying problem any index.php file gets displayed as a text file even though it has the extension .php. Note this is only for files named index.php I suppose this is a setting that needs to be changed but cant find any solution in the docs.

Anyone experienced same problem before...? Any help advice much appreciated.

Below you can see a sample image

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Timothy Coetzee
  • 5,626
  • 9
  • 34
  • 97
  • It doesn't do this for me. My `index.php` has the PHP icon. – Barmar Apr 21 '17 at 02:11
  • Whenever I've had problems with PhpStorm, JetBrains tech support has been very helpful. Why don't you contact them before switching. – Barmar Apr 21 '17 at 02:12
  • Thank you I have contacted them via their website – Timothy Coetzee Apr 21 '17 at 02:25
  • 1
    @TimothyCoetzee The answer given is correct -- I should have more than 10 similar answers in my own history -- here is exact duplicate: http://stackoverflow.com/a/22709627/783119. The reason is `index.php` pattern is more precise than generic `*.php` hence first pone overrides 2nd. How you have created such pattern -- it's another story (most likely accidentally, without checking what's happening on the screen -- e.g. http://stackoverflow.com/a/21281563/783119) – LazyOne Apr 21 '17 at 08:44

2 Answers2

6

Go to File-> Settings -> Editor -> File types and check text files. There will be an added pattern (index.php). Just romove it.

eisbach
  • 417
  • 3
  • 7
  • Have you checked "Registered Patterns" under the text files? There might be a pattern like index.php? – eisbach Apr 21 '17 at 02:42
  • 2
    @TimothyCoetzee But it sounds like you have another entry that's overriding the general pattern for this filename. – Barmar Apr 21 '17 at 02:42
2

I had this same problem but the above suggestions weren't helpful. I resorted to looking at my project files, and within .idea/misc.xml I found:

<component name="ProjectPlainTextFileTypeManager">
 <file url="file://$PROJECT_DIR$/path/to/myfile-c.php" />
</component>

Removing these lines fixes the problem. If I were to have this problem again, where would I find the setting in the user interface? It is apparently a project level override. Using phpStorm 9.x on MacOS.

Rob Brandt
  • 293
  • 4
  • 13