Я проверяю запрос как изображение, но выдает сообщение:
"Невозможно угадать тип MIME, так как нет доступных отгадчиков (вы включили расширение php_fileinfo?)".
В php.ini
у меня нет extension=php_fileinfo
, но у меня есть строка без комментария extension=fileinfo
(я вижу, что Люмен поместил эту и другие зависимости без 'php_'
). Я также пытаюсь добавить extension=php_fileinfo
, но при перезапуске Apache из XAMPP происходит сбой, потому что он не находит эту зависимость. Что мне делать?
Код:
function updateProfilePicture(Request $request) {
$this->validate($request, [
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
]);
//...
Раздел php .ini, где зависимость fileinfo:
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename
;
; For example:
;
; extension=mysqli
;
; When the extension library to load is not located in the default extension
; directory, You may specify an absolute path to the library file:
;
; extension=/path/to/extension/mysqli.so
;
; Note : The syntax used in previous PHP versions ('extension=<ext>.so' and
; 'extension='php_<ext>.dll') is supported for legacy reasons and may be
; deprecated in a future PHP major version. So, when it is possible, please
; move to the new ('extension=<ext>) syntax.
;
; Notes for Windows environments :
;
; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.
;
extension=bz2
extension=curl
extension=fileinfo
extension=gd2
extension=gettext
Возможно, это связано с этим отказ от ответственности о том, как установить директивы зависимостей? (Я не уверен, потому что extension=fileinfo
уже был в файле по умолчанию) Я использую windows 10, и я нашел файл в C:\xampp\php\ext\php_fileinfo.dll