Die beiden Module müssen an sein. In php.ini
sudo nano /etc/php/7.2/fpm/php.ini
extension=mbstring
extension=exif ; Must be after mbstring as it depends on it
Danach
sudo /etc/init.d/php7.2-fpm reload
sudo service nginx restart
Test Datei auslesen
<?php
//Exif-Daten auslesen und in Array $Exif speichern
$Exif = exif_read_data("upload/IMG_20181008_151605_ergebnis.jpg", 0, true);
if($Exif === false)
{
echo"Keine Exif-Daten gefunden..";
}
else
{
foreach($Exif as $Schluessel=>$Abschnitt)
{
foreach($Abschnitt as $Name=>$Wert)
{
echo"$Schluessel.$Name: $Wert<br>\n";
}
}
}
?>
Quelle: https://www.vektorkneter.de/exif-daten-aus-jpeg-bilder-auslesen/
Ausgabe
FILE.FileName: IMG_20181008_151605_ergebnis.jpg
FILE.FileDateTime: 1541083378
FILE.FileSize: 123626
FILE.FileType: 2
FILE.MimeType: image/jpeg
FILE.SectionsFound: ANY_TAG, IFD0, EXIF, GPS
COMPUTED.html: width="800" height="600"
COMPUTED.Height: 600
COMPUTED.Width: 800
COMPUTED.IsColor: 1
COMPUTED.ByteOrderMotorola: 1
COMPUTED.ApertureFNumber: f/2.0
IFD0.Model: Nokia 8
IFD0.ImageWidth: 800
IFD0.ImageLength: 600
IFD0.DateTime: 2018:10:08 15:16:05
IFD0.Orientation: 1
IFD0.Exif_IFD_Pointer: 126
IFD0.GPS_IFD_Pointer: 404
EXIF.FNumber: 200/100
EXIF.ExposureTime: 4625759/1000000000
EXIF.SubSecTimeDigitized: 550
EXIF.SubSecTimeOriginal: 550
EXIF.SubSecTime: 550
EXIF.FocalLength: 3580/1000
EXIF.Flash: 0
EXIF.ISOSpeedRatings: 100
EXIF.DateTimeDigitized: 2018:10:08 15:16:05
EXIF.DateTimeOriginal: 2018:10:08 15:16:05
EXIF.ExifImageLength: 600
EXIF.WhiteBalance: 1
EXIF.ExifImageWidth: 800
EXIF.ApertureValue: 200/100
EXIF.ShutterSpeedValue: 7756/1000
EXIF.ExifVersion: 0220
GPS.GPSLatitudeRef: N
GPS.GPSLatitude: Array
GPS.GPSLongitudeRef: E
GPS.GPSLongitude: Array
GPS.GPSTimeStamp: Array
GPS.GPSDateStamp: 2018:10:08