2

Fatal error: Uncaught Error: Call to undefined function mime_content_type() in when trying to upload image from admin blocks.
Please check screenshot enter image description here

9
  • Do you have any custom module ? Which might be conflicting with app/code/Magento/Cms/etc/di.xml Jan 19, 2019 at 12:38
  • no there is "no" custom module which is conflicting app/code/Magento/Cms/etc/di.xml Jan 19, 2019 at 13:25
  • 3
    You will need to enable php fileinfo extension.
    – user77378
    Feb 26, 2019 at 14:37
  • ok i will check and let you know Feb 26, 2019 at 14:56
  • 1
    @DavidDuong Yes, I have enabled fileinfo extension and it worked :) Feb 7, 2020 at 4:55

1 Answer 1

3

I wanted to elaborate for those that are want to know if they have fileinfo enabled and how to enable.

The below is for Centos will be similar for other Linux flavors

  • php -m | grep fileinfo (if you do not see any results you do not have it enabled)
  • php-config --extension-dir this will show you the location for you extensions, check if fileinfo.so is there
  • If you have fileinfo extension just uncomment for you php.ini (can be found with php -i | grep php.ini)
  • If you need to get the so file do the next few steps
  • php -v to get your php version
  • Go to https://www.php.net/downloads and download to your server the correct version
  • which phpize to get full path to phpize and take note of it
  • tar -zxvf php-x.x.x.tar.gz
  • cd php-x.x.x/ext/fileinfo/
  • ./configure -with-php-config=/use-path-from-above( without the phpize )/php-config
  • make && make install when this completes you should be done
  • php -m | grep fileinfo to confirm that it installed correctly
  • Enable fileinfo extension from php.ini extension=fileinfo.so
  • Restart php-fpm service php-fpm restart
1
  • I'm on cPanel so was the case of using easyapache wysiwyg to add fileinfo php extensions for the different versions of php but this answer pinpointed exactly what I was missing. More importantly this is not listed as a required extension devdocs.magento.com/guides/v2.4/install-gde/… Sep 2, 2020 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.