【问题标题】:Intervention not resizing large files干预不调整大文件的大小
【发布时间】:2015-02-27 01:17:12
【问题描述】:

我正在使用[Intervention][1] 来调整文件大小。我发现它没有调整像this one这样的大文件的大小

我使用的代码是:

if (Input::hasFile('image'))
            {
                $file = Input::file('image');
                $r = $file->move('uploads', $file->getClientOriginalName());
                Image::make('/mountain.jpg')->resize(200,200)->save('uploads/k2.jpg');
                //print_r($image);
                exit;
            }

代码适用于较小的文件。文件大小为 2.x MB,我的 PHP 限制为 32MB。

更新:Laravel 日志说:

' with message 'Allowed memory size of 33554432 bytes exhausted (tried to allocate 3008 bytes`

【问题讨论】:

  • 你有什么错误吗?
  • 至少不在应用程序级别。我应该检查日志吗?
  • @MattBurrow 是的,我找到了这个:' with message 'Allowed memory size of 33554432 bytes exhausted (tried to allocate 3008 bytes
  • 在 php.ini 中增加 memory_limit 值。

标签: php laravel-4


【解决方案1】:

通过找出你的错误日志信息; Allowed memory size of 33554432 bytes exhausted (tried to allocate 3008 bytes,您的应用内存不足。

通过更改 php.ini 文件中 memory_limit 的值来增加此值。

请务必重新启动您的网络服务器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-28
    • 2018-09-21
    • 2016-05-28
    • 1970-01-01
    • 1970-01-01
    • 2013-12-13
    • 1970-01-01
    相关资源
    最近更新 更多