2015-04-03 9 views
5

का उपयोग कर एस 3 के साथ लैरवेल की फाइलसिस्टम मैं एस 3 पर वस्तुओं को स्टोर करने के लिए लैरवेल के फाइल सिस्टम का उपयोग कर रहा हूं और मुझे गलत यूआरएल मिल रहा है।गलत यूआरएल

Storage::disk('s3')->put('file.txt', 'Contents'); 

मुझे

CurlException in CurlMulti.php line 359: 
[curl] 6: Could not resolve host: mybucket.s3.website-us-east-1.amazonaws.com [url] https://mybucket.s3.website-us-east-1.amazonaws.com/file.txt 

त्रुटि यह URL

mybucket.s3.website-us-east-1.amazonaws.com

होना चाहिए देता है

mybucket.s3-website-us-east-1.amazonaws.com

config/filesystem.php

's3' => [ 
    'driver' => 's3', 
    'key' => env('S3_KEY'), 
    'secret' => env('S3_SECRET'), 
    'region' => env('S3_REGION'), 
    'bucket' => env('S3_BUCKET'), 
], 

.env

S3_KEY=MYKEY 
S3_SECRET=mySecr3tmySecr3tmySecr3tmySecr3t 
S3_REGION=website-us-east-1 
S3_BUCKET=mybucket 
+0

शायद 'S3_REGION = s3-website-us-east-1' ...? –

+0

हाँ, मैंने कोशिश की कि उसने मुझे 'mybucket.s3.s3-website-us-east-1.amazonaws.com' – whoacowboy

+1

जैसा जोड़ा गया था, क्षेत्र को हटाने का समाधान मेरे लिए काम करता है: http://laravel.io/फोरम/04-03-2015-फाइल सिस्टम-साथ-s3-giving-me-the-wrong-s3-url –

उत्तर

19

मैं अंत में इस के लिए दो जवाब मिल गया।

's3' => [ 
    'driver' => 's3', 
    'key' => env('AWS_KEY'), 
    'secret' => env('AWS_SECRET_KEY'), 
    'region' => Aws\Common\Enum\Region::OREGON, 
    'bucket' => 'app-images', 
], 

क्षेत्रों A3 GitHub Repo पर पाया जा सकता:

One solution पूरी तरह

's3' => [ 
    'driver' => 's3', 
    'key' => env('S3_KEY'), 
    'secret' => env('S3_SECRET'), 
    'bucket' => env('S3_BUCKET'), 
], 

The other solution है जो मैं अंत में साथ चला गया यह था क्षेत्र संदर्भ दूर करने के लिए किया गया था।

class Region extends Enum 
{ 
    const US_EAST_1   = 'us-east-1'; 
    const VIRGINIA   = 'us-east-1'; 
    const NORTHERN_VIRGINIA = 'us-east-1'; 
    const US_WEST_1   = 'us-west-1'; 
    const CALIFORNIA   = 'us-west-1'; 
    const NORTHERN_CALIFORNIA = 'us-west-1'; 
    const US_WEST_2   = 'us-west-2'; 
    const OREGON    = 'us-west-2'; 
    const EU_WEST_1   = 'eu-west-1'; 
    const IRELAND    = 'eu-west-1'; 
    const LONDON    = 'eu-west-2'; 

    const EU_CENTRAL_1  = 'eu-central-1'; 
    const FRANKFURT   = 'eu-central-1'; 
    const AP_SOUTHEAST_1  = 'ap-southeast-1'; 
    const SINGAPORE   = 'ap-southeast-1'; 
    const AP_SOUTHEAST_2  = 'ap-southeast-2'; 
    const SYDNEY    = 'ap-southeast-2'; 
    const AP_NORTHEAST_1  = 'ap-northeast-1'; 
    const TOKYO    = 'ap-northeast-1'; 
    const SA_EAST_1   = 'sa-east-1'; 
    const SAO_PAULO   = 'sa-east-1'; 
    const CN_NORTH_1   = 'cn-north-1'; 
    const BEIJING    = 'cn-north-1'; 
    const US_GOV_WEST_1  = 'us-gov-west-1'; 
    const GOV_CLOUD_US  = 'us-gov-west-1'; 
} 
+0

मुझे 2 घंटे की तरह ही बांध की समस्या हो रही थी और मुझे कोई विचार नहीं है कि ऐसा कुछ क्यों ढूंढना मुश्किल है, इसके लिए कई सारे thanx – ctf0

संबंधित मुद्दे