mime_content_type() function not defined

后端 未结 6 1882
有刺的猬
有刺的猬 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:04

    If you are on shared hosting, chances are that the fileinfo PHP extension is either not enabled or installed.

    In the case where it's not enabled, navigate to the Software section of CPanel (consult documentation of your control panel if you're not using CPanel) and click Select PHP Version (or something related to that) and enable the extension by checking its box and saving your action.

    If it's not installed, the extension won't be part of the PHP extensions at cPanel > Software > Select PHP Version > Extensions, edit your php.ini file and uncomment extension=php_fileinfo.dll if you're on Windows. Consult your hosting provider's docs if any of these don't work.

提交回复
热议问题