将文件发送到Laravel中的服务器aws s3时出错

时间:2017-04-04 16:51:24

标签: laravel amazon-web-services amazon-s3 laravel-5.4

我正在尝试将文件上传到Amazon s3服务器,我按照Laravel 5.4文档讨论了FileSystems。但它返回错误:

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)

路线

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

Auth::routes();

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

控制器

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

.ENV

AWS_KEY=BKBAJKD62Y324W4T7QUA (
AWS_SECRET=tbG3prt8vrXp5leUp5S65xbak08ZrLBZPNdO+fbC
AWS_REGION=us-east-1
AWS_BUCKET=comercio-urbano

有什么建议吗?

1 个答案:

答案 0 :(得分:1)

如果您在Windows上使用XAMPP,则需要下载certificate并将其添加到$('body').on('click', "[data-new-save]", function () { $.ajax({ url: "/awesome", type: "POST", data: awesomeDetails, success: function () { console.log("Cool beans"); refreshContent(); // Re-renders content // Feedback $("nav").after("<div class=\"flash success\">Success!</div>"); setTimeout(function () { $(".flash").remove(); }, 5000); }, error: function () { console.log("Welp"); // Feedback $(".navigation").after("<div class=\"flash error\">Failure</div>"); setTimeout(function () { $(".flash").remove(); }, 5000); } }); });

php.ini

然后重启XAMPP(或Apache)。