【问题标题】:laravel 4 returns error in file uploadlaravel 4 在文件上传中返回错误
【发布时间】:2014-02-21 00:39:08
【问题描述】:

我的问题是当我尝试上传大图片时出现上传错误。 (大于 2MB)。

我在 php.ini 中的上传大小限制为 40MB,但我仍然收到以下错误:

 development.ERROR: exception 'Exception' with message Serialization of   Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Session/Store.php:212
 Stack trace:
 #0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Session/Store.php(212): serialize(Array)
 #1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(126): Illuminate\Session\Store->save()
 #2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(79): Illuminate\Session\Middleware->closeSession(Object(Illuminate\Session\Store))
 #3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
 #4 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
 #5 /var/www/laravel/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
 #6 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(606): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
 #7 /var/www/laravel/public/index.php(61): Illuminate\Foundation\Application->run()
 #8 {main} [] []

为什么我会收到错误消息?

【问题讨论】:

  • 跳转到终端sudo chmod -R 755 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Session如果还是一样试试777
  • 我试过了,但还是出现同样的错误。

标签: php image file-upload laravel laravel-4


【解决方案1】:

您如何尝试上传文件?使用带有 bundle 的原生 laravel 上传功能?权限可能只是问题之一。

【讨论】:

  • 我只使用原生上传。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-08-11
  • 2013-11-14
  • 1970-01-01
  • 2013-07-22
  • 2013-04-06
  • 2015-03-21
相关资源
最近更新 更多