Error sending files to server aws s3 in Laravel

2

I'm trying to upload a file to Amazon's s3 server, I followed the Laravel 5.4 documentation that talks about FileSystems. But it returns the error:

Error executing "ListObjects" on "https://s3.amazonaws.com/comercio-urbano?prefix=myfile.txt%2F&max-keys=1&encoding-type=url"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Routes

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', 'HomeController@index');
Route::get('/test', 'TesteController@teste');

Controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class TesteController extends Controller
{
    public function teste()
    {
      echo '123';
      $s3 = Storage::disk('s3');
      $s3->put('myfile.txt', 'Teste', 'public');
    }
}

FileSystems

's3' => [
            'driver' => 's3',
            'key' => env('AWS_KEY'),
            'secret' => env('AWS_SECRET'),
            'region' => env('AWS_REGION'),
            'bucket' => env('AWS_BUCKET'),
        ],

.ENV

AWS_KEY=AKIAJKD62YA24W4T5QUA
AWS_SECRET=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
AWS_REGION=us-east-1
AWS_BUCKET=comercio-urbano

Any suggestions?

    
asked by anonymous 04.04.2017 / 16:00

1 answer

1

When using the flysystem, you should avoid using the localhost domain, create a hostname for the local machine as below and it should work:

http://local.dev
    
05.04.2017 / 13:52