Title: PHP finfo errors / Failed to load Magic Database
Last modified: August 21, 2016

---

# PHP finfo errors / Failed to load Magic Database

 *  Resolved [metagrapher](https://wordpress.org/support/users/metagrapher/)
 * (@metagrapher)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/php-finfo-errors-failed-to-load-magic-database/)
 * Hello,
    I am getting the following errors, on the optimization page, any time
   I attempt to optimize an image, or even load the page:
 * Warning: finfo_open() [function.finfo-open]: Failed to load magic database at‘/
   usr/share/misc/magic’. in /home/magnaope/public_html/dev.magnaoperagroup.com/
   wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 465
 * Warning: finfo_file(): supplied argument is not a valid file_info resource in/
   home/magnaope/public_html/dev.magnaoperagroup.com/wp-content/plugins/ewww-image-
   optimizer/ewww-image-optimizer.php on line 467
 * Warning: finfo_close(): supplied argument is not a valid file_info resource in/
   home/magnaope/public_html/dev.magnaoperagroup.com/wp-content/plugins/ewww-image-
   optimizer/ewww-image-optimizer.php on line 469
 * I do have ImageMagick installed, which is what this seems to reference, and EWWW
   IO seems to be able to find the ImageMagick installation. I’ve tried changing
   the setting: “Use System Paths” to see if that effected this error, and it does
   not. It made the error go away from the plugin page itself, but not from the 
   optimization pages.
 * Debug Info: [http://pastebin.com/HYJ50Zgk](http://pastebin.com/HYJ50Zgk)
 * EWWW Image Optimizer Version 1.7.5
    PHP Version: 5.3.27
 * According to phpinfo() FileInfo support is enabled.
    ImageMagick is installed
   v 3.1.2
 * I’ve tried to add `&& defined('FILEINFO_MIME')` to line 463, since in another
   thread you suggested that was the problem for someone else. I found that the 
   updated version already had most instances of this if clause corrected except
   on line 463, but this did not fix it for me. I suppose because I am actually 
   on PHP 5.3 and that FileInfo is enabled.
 * Thanks in advance for any help you can provide! 🙂
 * [http://wordpress.org/plugins/ewww-image-optimizer/](http://wordpress.org/plugins/ewww-image-optimizer/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/php-finfo-errors-failed-to-load-magic-database/#post-4431276)
 * You can see more discussion on a similar issue here: [http://wordpress.org/support/topic/errors-after-moving-server-2?replies=10](http://wordpress.org/support/topic/errors-after-moving-server-2?replies=10)
 * The problem is a php misconfiguration with the fileinfo commands, and actually
   has nothing to do with ImageMagick. Fileinfo is used to determine the mimetype
   of images, and it needs a valid ‘magic’ database to do so. If it is not configured
   properly, it defaults to ‘/usr/share/misc/magic’.
 * You should report the issue to your webhost, and work with them to correct the
   issue.

Viewing 1 replies (of 1 total)

The topic ‘PHP finfo errors / Failed to load Magic Database’ is closed to new replies.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [nosilver4u](https://wordpress.org/support/users/nosilver4u/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/php-finfo-errors-failed-to-load-magic-database/#post-4431276)
 * Status: resolved