dounao1856 2018-02-02 13:57
浏览 165

从实例配置文件元数据服务器检索凭据时出错:使用Laravel s3

I am developing a web application using Laravel. In my application, I develop a feature for uploading the file to the server. But, I will store the files in the Amazon S3 bucket instead. So, I am just following the Laravel official documentation - https://laravel.com/docs/5.5/filesystem. But I am getting an error. Please see what I have done below.

First I run this command to install required package in the terminal

composer require league/flysystem-aws-s3-v3

Then in the environment file, I added these variable

AWS_IAM_KEY=xxxxxxx
AWS_IAM_SECRET=xvxxxx
AWS_REGION=eu-west-2
AWS_BUCKET=xxxxxxx

Then in the controller, I upload like this.

$request->file('photo_file')->store(
      'activity_files/'.uniqid(), 's3'
 );

When I upload the file, it is giving me this error.

Error retrieving credentials from the instance profile metadata server. (cURL error 7: Failed to connect to 169.254.169.254 port 80: Network unreachable (see http://curl.haxx.se/libcurl/c/libcurl-errors.html))

What is wrong with my code?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
    • ¥20 matlab yalmip kkt 双层优化问题
    • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
    • ¥88 实在没有想法,需要个思路
    • ¥15 MATLAB报错输入参数太多
    • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
    • ¥15 有赏,i卡绘世画不出