0

I got a photo competition that seems to work fine but when I upload a photo I get a blank screen. I checked the error log and found this:

PHP Fatal error: Call to undefined function exif_imagetype() in /home/fbtabvhk/public_html/pinkdrive_selfie/contest/libs/upload/save.php on line 27

This is the code on line 27:

if (exif_imagetype($_FILES['files']['tmp_name'][0]) === FALSE)
BenMorel
  • 34,448
  • 50
  • 182
  • 322
Andy_Pod3d
  • 1
  • 1
  • 1
  • 4
  • 1
    possible duplicate of [Call to undefined function exif\_imagetype()](http://stackoverflow.com/questions/16175702/call-to-undefined-function-exif-imagetype) – izstas Jun 01 '14 at 09:37

2 Answers2

2

You have to have the exif extension compiled and enabled for this function to work. This extension has good chances to be already compiled in your PHP installation, so you might just have to enable it in your php.ini:

On Linux:

extension=exif.so

On Windows:

extension=php_exif.dll

Note for Windows:

Windows users must enable both the php_mbstring.dll and php_exif.dll DLL's in php.ini. The php_mbstring.dll DLL must be loaded before the php_exif.dll DLL so adjust your php.ini accordingly.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • The ISP Changed the php.ini file and compiled and enabled the exif extension but in an still sitting with the same issue :-( i gave them this thread url so they can see exactly what needs to be done. Any suggestions please? – Andy_Pod3d Jun 01 '14 at 13:17
  • They probably forgot to enable it, or to restart the web server. If the output of `var_export(extension_loaded('exif'));` is `false`, the problem is still in their hands! – BenMorel Jun 01 '14 at 19:09
0

Try to enable your php.ini and restart server.

extension=php_exif.dll
pavel
  • 26,538
  • 10
  • 45
  • 61
  • Thank you so much for the advice will need to contact my ISP don't have access to the php.ini file. will revert back if i am unsuccessful – Andy_Pod3d Jun 01 '14 at 09:57