Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gurvindersingh's avatar

Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?"

i am trying to upload an image but it gives an error

Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?

and my php.ini has no 'php_fileinfo' extension

0 likes
10 replies
Cronix's avatar

It would be better to check phpinfo rather than php.ini. Depending on how php is installed/setup, the extensions might not get loaded straight from php.ini. Typically there is another dir like conf.d or something where the plugins are loaded from.

create this route:

Route::get('/phpinfo', function() {
    phpinfo();
});

and then visit it in the browser. It will create an html page with everything your php has installed and is using. Search for "fileinfo".

Once you're done, delete that route. It's a security risk to leave that enabled.

If fileinfo really isn't installed, we'd have to know more about your system. Like the OS, version, etc., along with the version of php you have installed.

gurvindersingh's avatar

Thank you @Cronix for response

fileinfo is shown in module authors table

and i have checked there is

'extension=fileinfo' in php.ini file

but no 'php_fileinfo' exists in php.ini file

OS: Windows 10 enterprise, PHP version: 7.1.14

Cronix's avatar

fileinfo is shown in module authors table

I don't know what that means. Do you mean it showed it was enabled when looking at the phpinfo route?

gurvindersingh's avatar

@Cronix Sir,

I have 'extension=fileinfo' in 'php.ini' file

Is this 'extension=fileinfo' is same as 'extension=php_fileinfo.dll' ?

And when i searched in 'phpinfo' html file i see there is 'fileinfo' under module authors table. I don't know what does this 'fileinfo' mean. Is it mean 'extension=php_fileinfo.dll' is enabled?

Cronix's avatar

if you went to the phpinfo route, and it showed a section called #fileinfo and it had fileinfo support enabled then the extension is enabled.

It may be that whatever file you're trying to upload is corrupt and not reporting the file metadata correctly.

Cronix's avatar

Maybe you can try uploading the file using this service, which will tell you the mime type. If it can't figure it out either, your file probably isn't saved correctly.

http://mime.ritey.com/

Cronix's avatar

It's been awhile since I've used windows. How did you install php? You can google for instructions, or if you installed it with wamp or something check the docs for it.

gurvindersingh's avatar
gurvindersingh
OP
Best Answer
Level 1

Now i'm using virtual host 'blog.test' to access my project 'blog' now it's working fine.

This problem is solved using virtual host instead of 'php artisan serve'

1 like

Please or to participate in this conversation.