Can’t use exif() on my server while localhost works fine


Somehow I can’t use the exif() function on my sever anymore. It used to work and I don’t know what change caused the error. I neither did a Kirby update nor changed any of my files or server settings. The following code is part of a plugin I use to generate <figure>s:

if ($image->exif()) {
   $year = date('Y', $image->exif()->timestamp());

Where $image is an image object (e.g. from $image = $page->files()->find($page->mainimage())) passed to the function. It used to work on my server and still works on my local host (MAMP)

Her are some infos from phpinfo():

                       localhost               server
PHP Version            5.6.10                  5.6.18
System                 Darwin …                Linux …
Server API             Apache 2.0 Handler      CGI/FastCGI
PHP API                20131106                (same)
PHP Extension          20131226                (same)
Zend Extension         220131226               (same)
Zend Extension Build   API220131226,NTS        (same)
PHP Extension Build    API20131226,NTS         (same)

“Dosen’t work” means that the generated HTML stops/breaks in the line where the plugin is called with no further output and no error messages (debug mode in Kirby is on).

I hav absolutly no idea what could cause this and hope you can help me with this issue. Let me know if you need more information.

Thanks in advance!

exif() requires the EXIF PHP extension to be installed. Does EXIF Support: enabled appear somewhere in your phpinfo()?

Seems like it is not. On my local host i found --enable-exif and and some mor information about the EXIF module on the server I just found EXIF in the list of module authors but nowhere else. That why I guess it isn’t enabled (anymore) on my serve.

At the moment I’m trying to contact my provider and ask for help. I’ll let you know about the results.

Yep, that’s what I’d recommend as well. :slight_smile: