WebFaction
Community site: login faq

I've recently received these errors when trying to get the information of a file using finfo:

finfo::finfo(): Warning: New continuation level 2 is more than one larger than current level 0
finfo::finfo(): Warning: New continuation level 3 is more than one larger than current level 1
finfo::finfo(): Warning: New continuation level 3 is more than one larger than current level 1
finfo::finfo(): Warning: New continuation level 3 is more than one larger than current level 1

The problem occurs when I try to use the magic database at /usr/share/misc/magic.

asked 09 Jul '13, 11:52

Micheal Mand
4614
accept rate: 100%


These errors/warnings are occurring because the PHP fileinfo extension does not implement the entire 'magic' file specification. Therefore, it is unable to parse the system's /usr/share/misc/magic file completely.

To solve the problem, you can use a copy of the magic file from PHP's source located here: ext/fileinfo/tests/magic.

Place that file somewhere within your home directory and use it when you call finfo, instead of /usr/share/misc/magic.

permanent link

answered 09 Jul '13, 11:55

Micheal Mand
4614
accept rate: 100%

PER PHP.NET default value with automatically pull in the php source magic file.

magic_file Name of a magic database file, usually something like /path/to/magic.mime. If not specified, the MAGIC environment variable is used. If the environment variable isn't set, then PHP's bundled magic database will be used.

permanent link

answered 27 Apr '15, 14:01

Artistan
111
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×265
×5
×3
×1

question asked: 09 Jul '13, 11:52

question was seen: 8,752 times

last updated: 27 Apr '15, 14:01

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM