简体   繁体   English

通过 Laravel 7.0 上传图像时出错

[英]Error while uploading image through Laravel 7.0

I am trying to upload image but it gives me following error我正在尝试上传图片,但它给了我以下错误

在此处输入图像描述

I've also added extension=php_fileinfo.dll in my php.ini file but still it gives me the same error as above image.我还在我的 php.ini 文件中添加了 extension=php_fileinfo.dll ,但它仍然给我与上图相同的错误。 How can I solve it?我该如何解决?

You may have edited the wrong php.ini file, as some environments can have multiple php.ini files due to different configurations of PHP.您可能编辑了错误的php.ini文件,因为 PHP 的配置不同,某些环境可能有多个php.ini文件。 To check to see if the PHP version you are using is actually loading the extension, you can type php -m within your project terminal to see loaded modules, alternatively you can dd(get_loaded_extensions());要检查您使用的 PHP 版本是否实际上正在加载扩展,您可以在项目终端中键入php -m以查看加载的模块,或者您可以dd(get_loaded_extensions()); within your PHP somewhere to see similar results.在您的 PHP 某处看到类似的结果。

If your extension is not loaded, it most likely means you have edited the wrong file.如果您的扩展程序未加载,则很可能意味着您编辑了错误的文件。 Therefore you can type php --ini within your project terminal and check for the Loaded Configuration File .因此,您可以在项目终端中键入php --ini并检查Loaded Configuration File This is the php.ini file used by your CLI.这是 CLI 使用的php.ini文件。 Make sure the extension is uncommented within that file.确保扩展名在该文件中未注释。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM