2016-08-16 60 views
1

我已將我的項目上傳到godaddy並將公用文件夾內容移動到public_html。項目工作正常,但干預圖像無法在公共路徑上書寫,因爲它不在那裏。以下是消息:Laravel 5.2將公共文件夾更改爲共享服務器上的public_html

Can't write image data to path (/home/username/public/uploads/... 

所以很明顯public_path()是錯誤的,它仍指向public。但現在應該是public_html。 所以我的問題是我怎麼能改變這個在Laravel 5.2 public_html

+0

這個問題已經與同一主題的回答 –

+0

考慮符號鏈接'public'到'public_html'。 – ceejayoz

回答

2

試試這個在index.php文件:

$app = require_once __DIR__.'/../bootstrap/app.php'; 

// set the public path to this directory 
$app->bind('path.public', function() { 
    return __DIR__; 
}); 
相關問題