Wednesday, 10 October 2018

Call to undefined function Illuminate\Filesystem\finfo_file()

I have the following error showing up in my laravel.log file on a website I have running. How can I pin down where the error originates from? As the stack trace is so short I am unsure where to start.

[2017-07-03 16:05:13] production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined function Illuminate\Filesystem\finfo_file()' in /home/uksacbor/laravel-projects/attestation/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:254 Stack trace: #0 {main}

I've ran a search on the site's folder using sublime's global search for when finfo_file() is used and I've used it in a helper in a test...

private function prepareFileUpload($path, $name)
{
    TestCase::assertFileExists($path);

    $pathInfo = pathinfo($path);

    $copyPath = $pathInfo['dirname'] . $pathInfo['filename'] . '_copy' . $pathInfo['extension'];

    \File::copy($path, $copyPath);

    $finfo = finfo_open(FILEINFO_MIME_TYPE);

    $mime = finfo_file($finfo, $copyPath);

    return new \Illuminate\Http\UploadedFile($copyPath, $name, $mime, filesize($copyPath), null, true);
}

Currently, my tests are all passing.

Any ideas?



from Call to undefined function Illuminate\Filesystem\finfo_file()

No comments:

Post a Comment