Project

General

Profile

Actions

Bug #63634

closed

FAL update Metadata in LocalStorage not working because of buggy php

Added by Stefan Klug almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2014-12-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

I had the same issue described in #46020, namely that all my images where missing width/height information in sys_file.
All the mentioned fixes didn't really seem to help.
Finally it turned out, that the php version on the server is buggy. "php -v" says it is 5.3.29 (I know that's quite old, but it i officially supported by Typo3 6.2)

The problematic code is in TYPO3\CMS\Core\Resource\Driver\LocalDriver in getMimeTypeOfFile():

$fileInfo = new \finfo();
return $fileInfo->file($absoluteFilePath, FILEINFO_MIME_TYPE);

FILEINFO_MIME_TYPE is not defined in this php version (per php docs it should be defined for php > 5.3)

Changing the code to

if(!defined(FILEINFO_MIME_TYPE)) define(FILEINFO_MIME_TYPE, 16);
$fileInfo = new \finfo();
return $fileInfo->file($absoluteFilePath, FILEINFO_MIME_TYPE);

solved the problem. I don't know if FILEINFO_MIME_TYPE == 16 is true for every php version, so maybe we should fallback to using FILEINFO_MIME which is available.

After UPDATE sys_file SET missing=1 and resheduling the IndexUpdater everything is fine.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #46020: Image size is 0 when not scaledClosedAlexander Opitz2013-03-04

Actions
Actions

Also available in: Atom PDF