Function call undefined mime_content_type (), cannot change server settings

I have an error found in the header (function call undefined mime_content_type() ). I read about recompiling 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, in my opinion, is cleaner), but my server does not support this either!

My question is this: can I use ini_set() to set the value so that I can use mime_content_type() , or is there another way (hacking) to get the mime file type?

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

Thanks for any help.

+4
source share
1 answer

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

There is also a version in PEAR PHP_Compat .

+5
source

Source: https://habr.com/ru/post/1344175/


All Articles