php_exif.dll reported as not found


While making some alterations to my php.ini file yesterday I came across an old bug that has gotten me before where PHP throws an error regarding the EXIF PHP extension used by photo gallery applications and the like. In a nutshell the error says that php_exif.dll cannot be found despite it being in the extensions directory with the same NTFS permissions as every other PHP extension.

Solution for this little annoyance is actually quite simple, yet I've not been able to find an solid explanation for why it happens. The problem is caused by some sort of clash between the php_mbstring.dll extension (used for Multibyte character encoding) and the php_exif.dll extension which only occurs when PHP tries to load EXIF before Mbstring.

The problem here is that by default the PHP extensions in your php.ini file are listed in alphabetical order by default, which means if you just uncomment you EXIF and Mbstring extensions as they are like most of us then you are always going to have this problem. To avoid this problem all you have to do is cut and paste php_mbstring.dll so it is listed above php_exif.dll in you php.ini file. Do this are PHP will now be able to load both your EXIF and Mbstring extensions without an issue.

Average rating
(2 votes)