mime_content_type() function not defined

后端 未结 6 1884
有刺的猬
有刺的猬 2021-01-03 21:33

I am using the mime_content_type() function for file upload, it works fine on localhost however I\'m encountering the following error on my live server:

6条回答
  •  别那么骄傲
    2021-01-03 22:20

    You must have the mime_magic extension on. Check your php.ini and look in phpinfo(). By the way this function has been deprecated as the PECL extension Fileinfo provides the same functionality (and more) in a much cleaner way.

    Windows users must include the bundled php_fileinfo.dll DLL file in php.ini to enable this extension.

    The libmagic library is bundled with PHP, but includes PHP specific changes. A patch against libmagic named libmagic.patch is maintained and may be found within the PHP fileinfo extensions source.

    Read more

提交回复
热议问题