Bojangles
Bojangles

Reputation: 101513

Call to undefined function mime_content_type(), can't change server settings

I have the error found in the title (Call to undefined function mime_content_type()). I've read about re-compiling PHP, as well as using finfo_open(FILEINFO_MIME_TYPE);. The problem with the latter is that my PHP version is 5.2.15, which is too old to support finfo, so I switched to mime_content_type() (which is cleaner, in my opinion), but my server doesn't support that either!

My question is this: can I use ini_set() to set a value so I can use mime_content_type(), or is there another (hackier maybe) way to get a file's mime type?

Here is my PHPinfo(): http://staging.cliquesoft.org/cs/infos.php

Thanks for any help.

Upvotes: 4

Views: 15459

Answers (1)

mario
mario

Reputation: 145482

You can use the reimplementation from http://upgradephp.berlios.de/. It defines te mime_content_type function if missing. You find it in include("ext/mime.php");

There's also a version in PEARs PHP_Compat.

Upvotes: 5

Related Questions