简体   繁体   English

PhpStorm - 如果名称为“myclass.php”,则无法打开PHP文件

[英]PhpStorm - can't open a PHP file if the name is “myclass.php”

I've a really CRAZY issue with PhpStorm, and I don't know how to solve it. 我和PhpStorm有一个非常疯狂的问题,我不知道如何解决它。

I have an empty php file called "myclass.php" which seems not recognized by PhpStorm because the icon is a "?". 我有一个名为“myclass.php”的空文件,似乎PhpStorm无法识别,因为图标是“?”。

When I try to open this file with PhpStorm, the mouse starts doing flicker and my IDE freezes until I restart it... However, I can open the file from any other IDE like notepad. 当我尝试用PhpStorm打开这个文件时,鼠标开始闪烁,我的IDE冻结,直到我重新启动它...但是,我可以从任何其他IDE打开文件,如记事本。 Also, I am the only one having this issue, because my other team workers can open the file with their PhpStorm IDE. 此外,我是唯一一个遇到此问题的人,因为我的其他团队工作人员可以使用他们的PhpStorm IDE打开文件。

BUT, when I rename the file to "myclass2.php", the icon changes like my other php files, and I am able to open it. 但是,当我将文件重命名为“myclass2.php”时,图标会像我的其他php文件一样变化,我可以打开它。

It's precisely when the file is called "myclass.php" that the issue is triggered. 正是在文件被称为“myclass.php”时才会触发问题。

I tried : 我试过了 :

  • File/Invalidate Cache / Restart 文件/无效缓存/重启
  • Uninstall/install PhpStorm 卸载/安装PhpStorm
  • Move the file into another folder 将文件移动到另一个文件夹
  • Drop/Recreate my project 删除/重新创建我的项目
  • Delete/Create the file with the same name with another IDE... 删除/创建与另一个IDE同名的文件...
  • Create the same file in another project 在另一个项目中创建相同的文件
  • Searching for an encoding issue 正在搜索编码问题

Someone knows how to solve this crazy issue ? 有人知道如何解决这个疯狂的问题吗? :( :(

Thanks you. 谢谢。

Please go to File | 请转到文件| Settings (or PhpStorm | Preferences) | 设置(或PhpStorm |首选项)| Editor | 编辑| File Types, find there "Files Opened In Associated Applications" and check if myclass.php is registered there as pattern. 文件类型,找到“在关联的应用程序中打开的文件”并检查myclass.php是否在那里注册为模式。 If it's there then just remove it and it will be fixed. 如果它在那里然后删除它,它将被修复。

可能的原因:您已将myclass.php添加到已在关联应用程序文件类型( 设置|编辑器|文件类型 )中打开文件的已注册模式,并且.php扩展名可能已分配给PHPStorm本身:)请检查已注册的模式并确保myclass.php将从列表中删除

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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