2016-07-19 2 views
2

Error executing "ListObjects" on " https://s3.your-region.amazonaws.com/your-bucket?prefix=abc%2F1468895496.jpg%2F&max-keys=1&encoding-type=url "; AWS HTTP error: cURL error 6: Could not resolve host: s3.your-region.amazonaws.com (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)Laravel AWS S3 업로드 사진 오류 (지역 오류?)

<?php 
namespace App\Http\Controllers; 
use Illuminate\Contracts\Filesystem\Filesystem; 
use App\Product; 
use Illuminate\Http\Request; 
class ProductController extends Controller 
{ 
... 
public function store(Request $request) 
    { 
     $image = $request->file('file'); 
     $imageFileName = time() . '.' . $image->getClientOriginalExtension(); 
     $s3 = \Storage::disk('s3'); 
     $filePath = '/abc/' . $imageFileName; 
     $s3->put($filePath, file_get_contents($image), 'public'); 
     return redirect()->action('[email protected]'); 
    } 
+0

관련 : http://stackoverflow.com/questions/34588066/laravel-5-1-seems-not-to-be-adding-config-values-to-s3-upload/34599133 – pah

답변

2

은 내가 your-region, your-bucket 등은 기본값입니다 때문에 config/filesystems.php의 설정을 설정 havent 한 생각합니다.

이 섹션에서 변경하고 키, 암호, 지역 및 물통이 채워 졌는지 확인하십시오.

'disks' => [ 

    'local' => [ 
     'driver' => 'local', 
     'root' => storage_path('app'), 
    ], 

    'public' => [ 
     'driver' => 'local', 
     'root' => storage_path('app/public'), 
     'visibility' => 'public', 
    ], 

    // s3 part is here 
    's3' => [ 
     'driver' => 's3', 
     'key' => 'your-key', 
     'secret' => 'your-secret', 
     'region' => 'ap-southeast-1', // this is the region setting 
     'bucket' => 'your-bucket', 
    ], 

], 
관련 문제