启用 php_fileinfo 扩展?
Enable the php_fileinfo extension?
我正在尝试 post 图片文件格式的图片。
我的代码:
public function store ()
{
$data = request()->validate ([
'caption' => 'required',
'image' => 'required | image | mimes: jpeg, png, jpg, gif, svg | max: 2048'
]);
dd (request()->all());
}
但是出现错误:
Unable to guess the mime type as no guessers are
available (Did you enable the php_fileinfo extension?).
我在 Whosebug 上了解到启用文件信息。同时,我确保将其打开并重置。
我的 PHP 版本是 7.4 XAMPP 3.2.4.
谢谢大家!
我安装了不适合php版本的xampp,所以无法安装php_file扩展。您只需要:
B1: Uninstall current xampp.
B2: Reinstall xampp to match the PHP version.
B3: Turn on the appropriate utilities.
希望这个回答对您有所帮助!
enter image description here
我正在尝试 post 图片文件格式的图片。 我的代码:
public function store ()
{
$data = request()->validate ([
'caption' => 'required',
'image' => 'required | image | mimes: jpeg, png, jpg, gif, svg | max: 2048'
]);
dd (request()->all());
}
但是出现错误:
Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?).
我在 Whosebug 上了解到启用文件信息。同时,我确保将其打开并重置。
我的 PHP 版本是 7.4 XAMPP 3.2.4.
谢谢大家!
我安装了不适合php版本的xampp,所以无法安装php_file扩展。您只需要:
B1: Uninstall current xampp.
B2: Reinstall xampp to match the PHP version.
B3: Turn on the appropriate utilities.
希望这个回答对您有所帮助!
enter image description here