Sending large files Swoole with Laravel/Octane

647 Views Asked by At

I'm having issues with uploading files now that I'm using octane. At first I couldn't send files larger than 2M, reading this post: https://ghostzero.dev/blog/set-custom-package-max-length-for-swoole-in-laravel-octane I managed to solve

Now it is configured to send 100M, both in swoole and in php

php:

php configuration

octane:

'swoole' => [
        'options' => [
            'package_max_length' => 100 * 1024 * 1024, // 100M
        ],
    ]

However when I try to send files over 30M i got memory failure

INFO  {

INFO      "message": "Allowed memory size of 134217728 bytes exhausted (tried to allocate 1048576 bytes)",

   INFO      "exception": "Symfony\\Component\\ErrorHandler\\Error\\FatalError",

   INFO      "file": "/var/www/vendor/symfony/mime/FileinfoMimeTypeGuesser.php",

   INFO      "line": 60,

   INFO      "trace": []

   INFO  }
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 1048576 bytes) in /var/www/vendor/symfony/mime/FileinfoMimeTypeGuesser.php on line 60
1

There are 1 best solutions below

0
On

Increase memory_limit for php, because swoole upload files to memory.