Issue uploading image, call to undefined function finfo_buffer()

£可爱£侵袭症+ 提交于 2019-12-13 03:56:48

问题


Trying to upload an image via a script based on Laravel framework and coming across this error:

Call to undefined function Intervention\Image\finfo_buffer() 

     * Checks if string contains binary image data
*
* @param mixed $input
* @return boolean
*/
private function isBinary($input)
{
$mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), (string) $input);
return substr($mime, 0, 4) != 'text';
}

I'm not really that well versed on Laravel so would appreciate some help.

Regards


回答1:


You need fileinfo extension enabled for your PHP. See Call to undefined function Intervention\Image\finfo_buffer().

olivervogel commented on May 20:

ext-fileinfo is now required for installation.

Check your php.ini file to see if something along the line of extension=php_fileinfo.dll or extension=fileinfo.so is commented out. If so uncomment it and restart your web server.



来源:https://stackoverflow.com/questions/24998852/issue-uploading-image-call-to-undefined-function-finfo-buffer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!