NotionCommotion Posted August 8, 2021 Share Posted August 8, 2021 I am attempting to execute the following script on Centos 7 running Remi's PHP 8.0.9 using FPM, and get the following results. While not positive, it looks like it has something to do with failing to load magic database at "/usr/share/misc/magic" (see at the very end of this post for some relevant content). Any thoughts? Thanks <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $finfo = finfo_open(FILEINFO_MIME, "/usr/share/misc/magic"); // return mime type ala mimetype extension $finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic"); // return mime type ala mimetype extension Warning: finfo_open(): Printf format is too long for type `belong' in description `%ld x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%ld x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `, version %hhd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `, system %hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `, version %hhd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `, system %hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `, original size: %ld bytes' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `Mach-O fat file with %ld architectures' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): New continuation level 2 is more than one larger than current level 0 in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `, %ld records' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `short' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `short' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): New continuation level 2 is more than one larger than current level 0 in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `Volume %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `Universal EFI binary with %ld architectures' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `short' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `short' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `start cyl %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%ld blocks' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `pending inodes to free %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `pending inodes to free %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `pending inodes to free %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `pending inodes to free %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `size %lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `edition %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `%lu blocks,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `%lu files' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `size %lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `edition %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%lu blocks,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%lu files' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description ` fblock size = %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description ` block size = %ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%lu skin(s),' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `(%lu x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%lu),' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%lu frame(s),' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `Frame size %lu bytes,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%lu vertices/frame,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%lu texture coordinates,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%lu triangles/frame' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `version %lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%lu x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `, crypto type %hhu (unknown)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `, hash type %hhu (unknown)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `, %ld x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `bounding box [%hd,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd] -' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `[%hd,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd],' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `%hhd-bit' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd dpi,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `volume %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `, %ld x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `%hd images in file' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `%lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `filetype=%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `architecture=%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `architecture=%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `filetype=%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `architecture=%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `architecture=%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): New continuation level 3 is more than one larger than current level 1 in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `.%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `(txt=%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `dat=%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `bss=%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `sym=%ld)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `(txt=%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `dat=%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `bss=%ld,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `sym=%ld)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `text len %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `data len %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `BSS len %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `symboltab len %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `flags: 0x%lX,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `(version %04lx)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Current entry does not yet have a description for adding a MIME type in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `(%ld records)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `(%ld records)' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Overflow for numeric type `leshort' value 0x223e9f78 in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `%hd x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `%hd,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `beshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `, %lu x' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `%lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): New continuation level 3 is more than one larger than current level 1 in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `log volume #%ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `, %hd sections' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `size: %ld bytes' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `byte' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `UNKNOWN VERSION %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `%lu Hz' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `<%lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `~%lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `>%lu' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `, %ld pages' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `- data length 0x%lx' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `- version %ld' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `- [%ld -' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%ldx' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `long' in description `%ldx' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `version %hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `leshort' in description `.%hd' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `version %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `belong' in description `type: UNKNOWN (%lu),' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `version %lu,' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Printf format is too long for type `lelong' in description `type: UNKNOWN (%lu),' in /var/www/filetest/public/index.php on line 5 Warning: finfo_open(): Failed to load magic database at "/usr/share/misc/magic" in /var/www/filetest/public/index.php on line 5 Fatal error: Uncaught Exception: finfo::__construct(): Printf format is too long for type `belong' in description `%ld x' in /var/www/filetest/public/index.php:6 Stack trace: #0 /var/www/filetest/public/index.php(6): finfo->__construct() #1 {main} thrown in /var/www/filetest/public/index.php on line 6 [michael@devserver ~]$ ls -la /usr/share/misc total 2856 drwxr-xr-x. 2 root root 34 Jan 19 2021 . drwxr-xr-x. 134 root root 4096 Aug 4 15:08 .. -rw-r--r-- 1 root root 624579 Sep 30 2020 magic -rw-r--r-- 1 root root 2285896 Sep 30 2020 magic.mgc [michael@devserver ~]$ ls -la /usr/share/file total 8 drwxr-xr-x. 2 root root 18 Jan 19 2021 . drwxr-xr-x. 134 root root 4096 Aug 4 15:08 .. lrwxrwxrwx 1 root root 8 Jan 19 2021 magic -> ../magic [michael@devserver ~]$ ls -la /usr/share/file/magic lrwxrwxrwx 1 root root 8 Jan 19 2021 /usr/share/file/magic -> ../magic [michael@devserver ~]$ cat /etc/magic # Magic local data for file(1) command. # Insert here your local magic data. Format is described in magic(5). [michael@devserver ~]$ whereis magic magic: /etc/magic /usr/share/magic /usr/share/man/man5/magic.5.gz [michael@devserver ~]$ whereis libmagic libmagic:[michael@devserver ~]$ Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/ Share on other sites More sharing options...
requinix Posted August 8, 2021 Share Posted August 8, 2021 Try giving it the magic.mgc file instead. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588932 Share on other sites More sharing options...
NotionCommotion Posted August 8, 2021 Author Share Posted August 8, 2021 Already tried and no luck. <b>Fatal error</b>: Uncaught Exception: finfo::__construct(): offset `�����' invalid in /var/www/filetest/src/MediaType.php:104 I also thought that maybe it was a module but no longer think so. The following are not installed but I don't think the issue. Agree? Even if not a module issue, could it be a repo issue? I tried file_get_contents() on the file so don't think a permission issue. If it was corrupted, I would have expected some different message such as this one. Do you know how these files original were installed? Maybe uninstall and reinstall it? php-magickwand.x86_64 1.0.9-7.el7 epel php-magickwand-debuginfo.x86_64 1.0.9.2-19.el7.remi.5.4 remi-safe-debuginfo php-pecl-gmagick.x86_64 2.0.6~RC1-1.el7.remi.8.0 php-pecl-gmagick-debuginfo.x86_64 2.0.6~RC1-1.el7.remi.8.0 php-pecl-imagick.x86_64 3.4.4-17.el7.remi.8.0 remi-php80 php-pecl-imagick-debuginfo.x86_64 3.4.4-17.el7.remi.8.0 remi-php80-debuginfo php-pecl-imagick-devel.x86_64 3.4.4-17.el7.remi.8.0 remi-php80 php-pecl-imagick-im6.x86_64 3.5.1-1.el7.remi.8.0 remi-php80 php-pecl-imagick-im6-debuginfo.x86_64 3.5.1-1.el7.remi.8.0 remi-php80-debuginfo php-pecl-imagick-im6-devel.x86_64 3.5.1-1.el7.remi.8.0 remi-php80 php-pecl-imagick-im7.x86_64 3.5.1-1.el7.remi.8.0 remi-php80 php-pecl-imagick-im7-debuginfo.x86_64 3.5.1-1.el7.remi.8.0 remi-php80-debuginfo php-pecl-imagick-im7-devel.x86_64 3.5.1-1.el7.remi.8.0 remi-php80 Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588935 Share on other sites More sharing options...
requinix Posted August 8, 2021 Share Posted August 8, 2021 Vaguely remember having this same sort of "PHP's magic wants one thing but the OS has another" problem in the past... Any reason you can't use PHP's built-in magic data? Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588936 Share on other sites More sharing options...
NotionCommotion Posted August 9, 2021 Author Share Posted August 9, 2021 You mean mime_content_type()? As far as I know, doesn't detect JS/CSS/etc and says is plain text. Maybe not a big deal. Maybe not worry about it? Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588937 Share on other sites More sharing options...
requinix Posted August 9, 2021 Share Posted August 9, 2021 2 hours ago, NotionCommotion said: Maybe not worry about it? Maybe not. Running /usr/bin/file from PHP is another option. Deciding based on file extension is another. All depends what you need this MIME type for. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588939 Share on other sites More sharing options...
NotionCommotion Posted August 9, 2021 Author Share Posted August 9, 2021 6 hours ago, requinix said: Running /usr/bin/file from PHP is another option. Deciding based on file extension is another. Never used file before. man says it does in order filesystem tests, magic tests, and language tests. Works on the CLI. Don't know whether it got to magic tests. For magic tests, does it also use /usr/share/misc/magic, and were these support files installed specifically for file? If so, maybe uninstall and reinstall file? Is magic.mime described by mime_content_type a different file? It works on my system so maybe it has to be? My php.ini has no reference to magic as described by this post and maybe add it? 6 hours ago, requinix said: Deciding based on file extension is another. All depends what you need this MIME type for. Use case is cache for a simple proxy. Primary reason was to know which content-type header to include in the response and secondary to validate before saving to disk. mime_content_type doesn't work for the header part unless I add some custom logic for JS/CSS/etc files which come across as text/plain or sometimes text/html. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588946 Share on other sites More sharing options...
requinix Posted August 9, 2021 Share Posted August 9, 2021 3 hours ago, NotionCommotion said: Use case is cache for a simple proxy. What kind of proxy? Because a regular HTTP proxy isn't going to have this MIME type detection problem. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1588949 Share on other sites More sharing options...
NotionCommotion Posted August 10, 2021 Author Share Posted August 10, 2021 On 8/9/2021 at 8:21 AM, requinix said: What kind of proxy? Because a regular HTTP proxy isn't going to have this MIME type detection problem. How come I knew you were going to ask me this? Maybe "proxy" wasn't the right word. IT department arbitrarily restricts some sites which I need to access and it is a pain every time to contact them and get them to change it, so created a small site on my server which accepts a URL, makes a request to it using cURL, modifies the response body HTML to change resource urls to point to my server, modifies a couple of headers, and returns the response. If the request is for a js, css, png, etc resource, I first check if I have a copy and if not make a curl request to get it and save it for future requests. Works sometimes but other times get application/octet-stream. Maybe not worth the trouble... ��o���??_�L������n�ے��֗!J,��#�ԧ�5�i�Z![)ɘ3��`w&��� }8@�����q��!�: e������� "��ش���.��X;q��3��_F(����\�Vfc���e�DI�ey��v!����e���͛�y�����Tv_���$���Փ�;�t��������S��~�B1�;�m��Ѻ��+�6�9��\���z�[�s�z0�A��H����ym�!���e9&�{IvidFjqɊ*zw��X4-,BB`�H�4���(4�)B=��{���.�x�E��V:|���\�[~}�w����r�s���|�?u=�n���i�d������j�m�Df����dX:�d3��_��y0��0`AȂ��"K�@s%cy���d�p@0K}218lu���e�8���� ��JH��/�LyϮlAۦ��Ғ�*ʊF&E�ȦQ A�G�C�9=�K�Z���4�:��8��F^�� AU��ۦ|��)U��BZ7;R����9rH�;%>RrFfE��iҙ� >}��a-���p�������:8�)U�I� R�n�MVU�h��d}��L�>TWU��`��hצ�����`�['Q�O���|���B^��JWS�bvO�ۚr�`��9&���8aX9O����I*��ч�iD��j���VH�3 F�a�`��,lѧ���C�x@���?��l����=22������h\�@�ď�i ��s�iy�0���j���pZ �b&E�d��d�����AO���s����������F������zA��]��np�N|�����)b}|(�ŜNr���7��rw�����P�1����J�(��[�KA���Z,�m�oNЎ���L� ��~A�gS֮A��c@� �0<瀂�����$�_�����}��Vw��sQ�w�;-R�j�� Rmq�v���- d0����_��~�����h�� ve7���jE*}��~�'��d'��;)B�:��v����I��\}xm�e͑v�}2�PM��8&��n�d���{���.�[�|.���u|o�3U@v��0�y�~k��&N�9�I_���2PF;l!e��w|7����A�}�l\W�+,6���쪪l{%�$��x@5Wiw�n����=k^'*%��N � H�'��+Lc��t}��c����S'ɶ9�𧋆H�s?Y�]ђ'F�z �}���D�����]S�����vw<3jz�O9:���iL',�X�ׄ�����z�V֣Qc� R�-�\�\�3�0;�A���Ҁ��Q/�Ftlh�V<�e�,qOw0 ��.I�iT�|���� Z"�B@u�Oz�Щ�=lݹ��&�������{�4�MZq�� �Ryx2����A2��D��b���Js��J:�>7�W��Y�åy=�-��~�.�δ�Zg��w�y0���� R�%�I�&� �`�����44U7w�4۰���>�G����y�Uv"{��<7����'�pR��f�h<,6>.4y�Fr�IÑM0�E��Rθ:�Y@��4�.sq�V;U����y��ɸuV���o�j/�M�=��ֵ�����G�wo�}�;��]�q�=DA5�|�g)� Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589000 Share on other sites More sharing options...
requinix Posted August 10, 2021 Share Posted August 10, 2021 You could save the MIME type at the time of the first download... A stupid simple cache file is one where the first line is the MIME type and everything after is the content. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589001 Share on other sites More sharing options...
kicken Posted August 10, 2021 Share Posted August 10, 2021 1 hour ago, NotionCommotion said: so created a small site on my server which accepts a URL, makes a request to it using cURL, modifies the response body HTML to change resource urls to point to my server, modifies a couple of headers, and returns the response Setting up an actual proxy and configuring your browser to use it would be simpler if you can manage it. This is what I did ages ago when attending some college classes and their wifi was blocking various sites I wanted to use. I setup apache at home as a HTTP proxy and while on campus configured Firefox to use it. Otherwise, just capturing the mime type sent by the original server is really what you should do, rather than trying to determine the mime type later on. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589005 Share on other sites More sharing options...
NotionCommotion Posted August 11, 2021 Author Share Posted August 11, 2021 Thanks both, @requinix You mean a "stupid simple cache" is just a flat text file which contains the mime on the first line? @kicken Looked a little into Apache proxies. "Reverse" proxy, right? Probably would be both simpler and more robust. Do you recall if you were able to dynamically change the URL by the path as well as modify the css/js/image links so they don't get blocked? @Both What do you think the weird output is all about? The response header says it is text/html but PHP says it is application/octet-stream. Maybe compressed? A�G�C�9=�K�Z���4�:��8��F^�� AU��ۦ|��)U��BZ7;R����9rH�;%>RrFfE��iҙ� >}��a-���p�������:8�)U�I� R�n�MVU�h��d}��L�>TWU��`��hצ�����`�['Q�O���|���B^��JWS�bvO�ۚr�`�� Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589006 Share on other sites More sharing options...
kicken Posted August 11, 2021 Share Posted August 11, 2021 52 minutes ago, NotionCommotion said: Looked a little into Apache proxies. "Reverse" proxy, right? No, forward proxy using ProxyRequests On and CONNECT to handle https. For example: <VirtualHost *:443> ProxyRequests On <Proxy *> AuthType Basic AuthName "Proxy" AuthUserFile /var/www/.htpasswd AuthBasicProvider file Require valid-user </Proxy> </VirtualHost> Then you configure your browser to use the proxy and just browse normally. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589007 Share on other sites More sharing options...
kicken Posted August 11, 2021 Share Posted August 11, 2021 1 hour ago, NotionCommotion said: What do you think the weird output is all about? It's binary data. If the server says it's text/html, probably it's compressed text/html. The compression method would be indicated by a different header (Content-Encoding I think). Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589008 Share on other sites More sharing options...
requinix Posted August 11, 2021 Share Posted August 11, 2021 2 hours ago, NotionCommotion said: What do you think the weird output is all about? The response header says it is text/html but PHP says it is application/octet-stream. Maybe compressed? Can't tell from your post: it doesn't contain any printable magic bytes that I recognize, and the forum will have corrupted the binary data while trying to encode it to UTF-8. And kicken points out another problem trying to roll your own caching proxy: it's not just Content-Type but also Content-Encoding and a couple other headers you'll have to care about. So the simplest answer is to not do that. Quote Link to comment https://forums.phpfreaks.com/topic/313516-issues-with-fileinfo/#findComment-1589009 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.