Laravel File Storage Error

2019-09-16 09:20发布

问题:

I am developing a Laravel 5.4 app and deployed it to Heroku running on free dyno.I am using Google Drive as my cloud storage.I am trying to upload large file,size of 200-300 mb or small file of 10-12 kb to my cloud storage using nao-pon/flysystem.

While uploading file,I am getting this error:

(1/1) ErrorException
A non well formed numeric value encountered
in GoogleDriveAdapter.php (line 1143)
at HandleExceptions->handleError(8, 'A non well formed numeric value encountered', '/app/vendor/nao-pon/flysystem-google-drive/src/GoogleDriveAdapter.php', 1143, array('iniName' => 'memory_limit', 'val' => '128M', 'last' => 'm'))
in GoogleDriveAdapter.php (line 1143)

My file upload controller method is like this:

$file = $request->file('file');
$name = $file->getClientOriginalName();
$myfile=Storage::disk('google')->put($name,fopen($file, 'r+'));

In my .user.ini (To update Heroku server php.ini):

post_max_size = 800M

upload_max_filesize = 700M

Heroku's free dyno php memory limit: 512mb

Update:

I run composer update on my heroku console.Some packages have been updated.But not the symfony\var-dumper package.It's not installed neither updated.I have also try composer update symfony\var-dumper.The console returns Nothing to install or update. I am getting the same error