Debian EXIF PHP Picture data for WordPress and nextGEN

How to add or enable exif functions in php and Debian Linux.

I use WordPress and the excellent nextGEN gallery software to manage my site and my photography. I like nextGEN gallery as it seems to do a good job managing pictures and presenting them. It also has the ability to display your exif data if you have the right php modules installed and enabled.

I did not and my exif data and was not showing as enabled (or an option) in my nextGEN. I honestly expected this to be more complicated, but it was simple once I dug a little further. Thank you Debian and your wonderful default configurations. (compiling in this option into Debian’s build but not enabling it by default)

In Debian I did the regular aptitude search | grep exif and did not find anything particular to php and exif that was missing and should be installed. I figured I would look into the php config for my apache2 install.

vi /etc/php5/apache2/php.ini

I did find a section that had exif statements as you can see below. You will want to search for exif or go down until you find this section (Read about exif and php)

[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
;exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motorola = UCS-2BE
;exif.decode_unicode_intel    = UCS-2LE
;exif.encode_jis =
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel    = JIS

Uncomment the “exif.encode_unicode = ISO-8859-15” line so the new segment looks like below

[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motorola = UCS-2BE
;exif.decode_unicode_intel    = UCS-2LE
;exif.encode_jis =
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel    = JIS

Save your changes and then restart apache
/etc/init.d/apache2 restart


Your php5 will be able to read in exif photo data contained in your pictures and nextGEN gallery will be able to display this data. Assuming you have not re sized them in nextGEN gallery (as doing so will remove the exif data) and that the exif data is actually in the pictures to begin with.

You should see PHP Exif support : Yes ( Vx.x ) in the nextGEN gallery main config page.