【问题标题】:Current location of uploading file not correct for Laravel getRealPath()Laravel getRealPath() 上传文件的当前位置不正确
【发布时间】:2019-12-13 18:40:29
【问题描述】:

以下代码存在问题,它为大尺寸(大于 1Mb)文件提供了错误的位置。

$file = $request->file('file');
echo $file->getRealPath();

上面的代码给了我大文件的输出是“/var/www/xxxx/public”,这不是预期的。 但是对于小文件,它类似于“/tmp/phpC6PcYz”,这是预期的。

可能是什么问题?它似乎是一些服务器配置,例如内存限制。我将 PHP 内存限制增加到 1Gb,但问题仍然存在。

【问题讨论】:

  • 检查upload_max_filesize

标签: php linux laravel nginx


【解决方案1】:

也许你还需要定义upload_max_filesize

【讨论】:

    猜你喜欢
    • 2017-08-15
    • 2019-10-15
    • 1970-01-01
    • 2014-10-08
    • 1970-01-01
    • 1970-01-01
    • 2014-03-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多