2016-08-16 154 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__; 
});