做了一个上传图片的功能,在本地上传通过,服务器报 bug
Unable to guess the mime type as no guessers are available(Did you enable the PHP_fileinfo extension?)
主要原因是 PHP_fileinfo
未被开启.
解决
找到 PHP.ini
$ PHP -i | grep PHP.ini Configuration File (PHP.ini) Path => /usr/local/PHP/etc Loaded Configuration File => /usr/local/PHP/etc/PHP.ini
开启 PHP_fileinfo
$ vim /usr/local/PHP/etc/PHP.ini
找到:;extension=PHP_fileinfo.dll
去掉分号,
windows 是 dll 但如果是 linux 系统的话应该是extension=PHP_fileinfo.so