简体   繁体   English

启用 php_fileinfo 扩展?

[英]Enable the php_fileinfo extension?

I am trying to post images in the image file format.我正在尝试以图像文件格式发布图像。 My Code:我的代码:

public function store ()
{
    $data = request()->validate ([
        'caption' => 'required',
        'image' => 'required | image | mimes: jpeg, png, jpg, gif, svg | max: 2048'
    ]);

    dd (request()->all());
}

But an error appears:但是出现一个错误:

Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?).无法猜测 mime 类型,因为没有可用的猜测器(您是否启用了 php_fileinfo 扩展?)。

I learned on StackOverflow enable file info.我在 StackOverflow 上了解到启用文件信息。 Meanwhile, I made sure to turn it on and reset it.同时,我确保将其打开并重置。 My PHP version is 7.4 XAMPP 3.2.4.我的 PHP 版本是7.4 XAMPP 3.2.4.

Thank you, everyone!谢谢大家!

I installed xampp which is not suitable for the php version so it failed to install the php_file extension.我安装了不适合php版本的xampp,所以安装php_file扩展失败。 You just need:您只需要:

B1: Uninstall current xampp.
B2: Reinstall xampp to match the PHP version.
B3: Turn on the appropriate utilities.

Hope this answer is of help to you!希望这个回答对你有帮助!

enter image description here在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 PHP 中启用 php_fileinfo 扩展? - How to enable php_fileinfo extension in PHP? 您是否在Azure中启用了php_fileinfo扩展 - Did you enable the php_fileinfo extension in Azure php_fileinfo扩展名不适用于laravel 4在线 - php_fileinfo extension not working for laravel 4 in online Laravel“启用fileinfo扩展名后,由于没有可用的猜测器,因此无法猜测mime类型(是否启用了php_fileinfo扩展名?)” - Laravel “Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?)” when fileinfo extension is enabled 1/1)LogicException由于没有可用的猜测器,因此无法猜测mime类型(是否启用了php_fileinfo扩展名?) - 1/1) LogicException Unable to guess the mime type as no guessers are available (Did you enable the php_fileinfo extension?) 编译php后如何重新启用php_fileinfo扩展名 - how to reenable php_fileinfo extension after compile php Laravel文件下载 - 未启用php_fileinfo扩展 - Laravel file download - php_fileinfo extension not enabled .htaccess启用php fileinfo扩展 - .htaccess enable php fileinfo extension 如何在 Windows 10 中的 php.ini 中安装扩展 php_fileinfo - How can I install extension php_fileinfo in my php.ini in Windows 10 我如何启用 php fileinfo 扩展 - how do i enable php fileinfo extension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM