PhpStorm open file in a wrong format - phpstorm

PhpStorm is opening a php as an SQL file. I checked the extension and it is php but PhpStorm insist to open it as an SQL. I've tried to clear the cache but no use.

Go to settings and under Editor>file type.
add a file type that you want to add or may be you remove other file type.

Related

How to open a database file with no file type in SSMS?

I have a database file with no file type, I need to open it in SSMS first. When I try to open it, it says no editor for it. I tried to open it in a text editor by changing its name with a txt extension, it displayed unreadable code on the whole page. I have searched online it seems the only way is to change the file name with an extension. Is there any way to make SSMS recognize the generic extension file? Thanks
Larnu corrected me to use "Restore" instead of "Open". Thanks
New to database, need to learn everything.

Why is my PHP file class recognized as text file?

I'm working on a Laravel project and when I was creating a new file I miss spelled the php extension ("php") but I didn't notice until I clicked enter so my PHP class files now appear as text files in PhpStorm and appears no hints whenever I write something in any php file.
Im using PhpStorm 2020.2.
Settings (Preferences on macOS) | Editor | File Types
Locate "PHP" entry in the top list (Recognized File Types)
Ensure that the middle list (File Name Patterns) has *.php entry there.
If it's not there then add it. Looks like you somehow re-assigned it to the "Text" file type.
Altought blade.php get recognized right,
That's because *.blade.php is assigned to separate/dedicated "Blade" file type (so IDE can provide Blade-specific support there).
And if you already did as #LazyOne suggested and your file still showing as text then right click the file and do this:

I downloaded my chrome bookmarks to move to a new computer and it saved as a XML instead of HTML - when I try to convert i get an error

I tried using several conversions -- I've used Altova and a couple of other free software options. I don't know how to add the XML file for you to view but would really appreciate some help!
When I use the Export Bookmarks option on Chrome browser, by default, the only option it allows is to save as an HTML file. If you did mistakenly save as an XML file, then using an XML editor like use probably used from Altova will most likely create more errors.
1) I'd suggest, you first right-click on the XML bookmarks file and go to Properties tab and see if you can restore the oldest, least-modified version of it.
2) Then simply try renaming the extension of the bookmarks file from .xml to .html to see if it now works.

MediaWiki filepath Magic Word doesn't work for some files types

I'm trying to use the MediaWiki filepath magic word` so that I can create some template links that pass a specific MediaWiki file. Unfortunately with certain file types, filepath just returns nothing.
The file I'm trying to get the path for that's failing is a text file in this case. I have confirmed that I am using the correct filename as I can create a regular file link using [[File:Name.txt]], and {{filepath:Image.png}} works properly.
Example of what I'm trying to accomplish:
[http://server/processfile.php?path={{filepath:<filename>}} Process A File]
Is this a known issue? Is there an easy way that I can debug what's happening here?
After digging around a bunch more I was able to resolve the issue. It turns out that even though the MediaWiki would accept the file, it was being assigned a random mime type because it was a .yaml file.
After updating mime.types and mime.info in MediaWiki and adding the mime type (text/yaml) to my IIS configuration, I was able to get the downloads working and the file links showing up.
Full disclosure: I may have been using an incorrectly cased file name even though I said that I was using the correct file name. :P

A PHP script file doesn't have PHP syntax formatting

In my PhpStorm, the file index.php, doesn't look like a PHP script, but a plain text file. How can I fix it?
Settings | File Types | Text files
Find and remove unwanted pattern there -- I expect this to be index.php or very similar
Similar SO questions:
PHPStorm renders a particular file name as plain text
Pycharm utils.py not getting syntax highlight
Follow this steps:
Open PHPStorm settings by using Ctrl+Alt+S
In search box type File types
Select file types option from left side panel
Find PHP Files (PHP) from Recognized file types
Check for .php extension in below area (Registered Patterns). If not found add PHP.
Right click on index.php and select "Mark as PHP".
(This option is there on PHPStorm 7.x, I'm not sure about 6.)